Skip to content

Commit

Permalink
fix(none): fix dependencies compatibility (#1674)
Browse files Browse the repository at this point in the history
Working on a non sage project today and bumped into some react collisions from `ink`. moving `react` & `ink` back into support package.

refers:

- none

## Type of change

**PATCH: backwards compatible change**



This PR includes breaking changes to the following core packages:

- none

This PR includes breaking changes to the follow extensions:

- none

## Dependencies

### Adds

- none

### Removes

- none
  • Loading branch information
kellymears committed Sep 14, 2022
1 parent 3786363 commit 5c5bffd
Show file tree
Hide file tree
Showing 312 changed files with 1,170 additions and 1,944 deletions.
2 changes: 1 addition & 1 deletion sources/@repo/yarn-plugin-bud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@yarnpkg/cli": "3.2.3",
"@yarnpkg/core": "3.2.4",
"@yarnpkg/shell": "3.2.4",
"clipanion": "3.2.0-rc.11",
"clipanion": "3.2.0-rc.12",
"fs-extra": "10.1.0",
"helpful-decorators": "2.1.0",
"js-yaml": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion sources/@repo/yarn-plugin-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@yarnpkg/cli": "3.2.3",
"@yarnpkg/core": "3.2.4",
"@yarnpkg/shell": "3.2.4",
"clipanion": "3.2.0-rc.11",
"clipanion": "3.2.0-rc.12",
"fs-extra": "10.1.0",
"helpful-decorators": "2.1.0",
"lodash-es": "4.17.21",
Expand Down
7 changes: 1 addition & 6 deletions sources/@roots/bud-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,17 @@
"devDependencies": {
"@jest/globals": "29.0.1",
"@skypack/package-check": "0.2.2",
"@types/fs-extra": "9.0.13",
"@types/lodash-es": "4.17.6",
"@types/node": "16.11.48",
"webpack": "5.73.0"
},
"dependencies": {
"@roots/bud-framework": "workspace:sources/@roots/bud-framework",
"@roots/bud-support": "workspace:sources/@roots/bud-support",
"@roots/container": "workspace:sources/@roots/container",
"chalk": "5.0.1",
"copy-webpack-plugin": "11.0.0",
"fs-extra": "10.1.0",
"get-port": "6.1.2",
"globby": "13.1.2",
"helpful-decorators": "2.1.0",
"html-webpack-plugin": "5.5.0",
"lodash-es": "4.17.21",
"nanoid": "4.0.0",
"tslib": "2.4.0"
},
Expand Down
4 changes: 2 additions & 2 deletions sources/@roots/bud-api/src/api/service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Base from '@roots/bud-framework/services/api'
import {bind} from '@roots/bud-support/decorators'
import {isEmpty, isFunction} from '@roots/bud-support/lodash-es'
import chalk from 'chalk'
import {bind} from 'helpful-decorators'
import {isEmpty, isFunction} from 'lodash-es'

import {factory} from '../facade/facade.factory.js'
import * as methods from '../methods/index.js'
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/bundle/bundle.method.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud} from '@roots/bud-framework'
import {isRegExp, isString} from 'lodash-es'
import {isRegExp, isString} from '@roots/bud-support/lodash-es'
import {join, sep} from 'node:path'

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/config/config.method.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud} from '@roots/bud-framework'
import {isFunction} from 'lodash-es'
import {isFunction} from '@roots/bud-support/lodash-es'
import type {Configuration} from 'webpack'

export interface override {
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/entry/globAssets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {globby} from 'globby'
import globby from '@roots/bud-support/globby'

export async function globAssets(search: string): Promise<Array<string>> {
try {
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/entry/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud} from '@roots/bud-framework'
import {isArray, isString} from 'lodash-es'
import {isArray, isString} from '@roots/bud-support/lodash-es'

import {globAssets} from './globAssets.js'
import type {EntryObject} from './util'
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/entry/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud, Config} from '@roots/bud-framework'
import {isArray, isString} from 'lodash-es'
import {isArray, isString} from '@roots/bud-support/lodash-es'

export type EntryObject = Config.EntryObject

Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/minimize/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud} from '@roots/bud-framework'
import {isUndefined} from 'lodash-es'
import {isUndefined} from '@roots/bud-support/lodash-es'

/**
* Minimize function interface
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/persist/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud} from '@roots/bud-framework'
import {isString} from 'lodash-es'
import {isString} from '@roots/bud-support/lodash-es'

export interface persist {
(type?: 'memory' | 'filesystem' | false): Bud
Expand Down
7 changes: 6 additions & 1 deletion sources/@roots/bud-api/src/methods/proxy/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type {Bud} from '@roots/bud-framework/bud'
import type * as Server from '@roots/bud-framework/services/server'
import {isBoolean, isNumber, isString, isUndefined} from 'lodash-es'
import {
isBoolean,
isNumber,
isString,
isUndefined,
} from '@roots/bud-support/lodash-es'

/**
* Enables proxy middleware
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/runtime/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud} from '@roots/bud-framework'
import {isUndefined} from 'lodash-es'
import {isUndefined} from '@roots/bud-support/lodash-es'
import type {Configuration, EntryObject} from 'webpack'

export interface runtime {
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/serve/serve.method.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud} from '@roots/bud-framework'
import fs from 'fs-extra'
import * as fs from '@roots/bud-support/fs'
import getPort from 'get-port'
import type Https from 'node:https'
import type Http from 'node:https'
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/splitChunks/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Bud} from '@roots/bud-framework'
import {isUndefined} from 'lodash-es'
import {isUndefined} from '@roots/bud-support/lodash-es'
import type {Configuration} from 'webpack'

export interface method {
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/template/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {Bud} from '@roots/bud-framework'
import {isUndefined, omit} from '@roots/bud-support/lodash-es'
import type {Options as HtmlOptions} from 'html-webpack-plugin'
import {isUndefined, omit} from 'lodash-es'
import {dirname, resolve} from 'path'
import {fileURLToPath} from 'url'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bind} from 'helpful-decorators'
import {bind} from '@roots/bud-support/decorators'
import type HtmlWebpackPlugin from 'html-webpack-plugin'
import type {Compilation, Compiler} from 'webpack'

Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/use/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
Extension,
ExtensionLiteral,
} from '@roots/bud-framework/extension'
import {isArray, isFunction} from 'lodash-es'
import {isArray, isFunction} from '@roots/bud-support/lodash-es'

import {generateName, isPlugin} from './use.utilities.js'

Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-api/src/methods/use/use.utilities.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Constructor, Extension} from '@roots/bud-framework/extension'
import {isEqual, isFunction} from 'lodash-es'
import {isEqual, isFunction} from '@roots/bud-support/lodash-es'
import {nanoid} from 'nanoid'

/**
Expand Down
3 changes: 2 additions & 1 deletion sources/@roots/bud-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"include": ["src", "**/*.html"],
"exclude": ["lib", "node_modules", "src/**/*.test.ts"],
"references": [
{"path": "./../bud-framework/tsconfig.json"}
{"path": "./../bud-framework/tsconfig.json"},
{"path": "./../bud-support/tsconfig.json"},
]
}
5 changes: 2 additions & 3 deletions sources/@roots/bud-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@
"@roots/bud-api": "workspace:sources/@roots/bud-api",
"@roots/bud-build": "workspace:sources/@roots/bud-build",
"@skypack/package-check": "0.2.2",
"@types/fs-extra": "9.0.13",
"@types/lodash": "4.14.185",
"@types/node": "16.11.48",
"webpack": "5.73.0"
},
Expand All @@ -76,8 +74,9 @@
"@babel/plugin-proposal-object-rest-spread": "7.18.9",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-transform-runtime": "7.18.10",
"@babel/preset-env": "7.18.10",
"@babel/preset-env": "7.19.0",
"@roots/bud-framework": "workspace:sources/@roots/bud-framework",
"@roots/bud-support": "workspace:sources/@roots/bud-support",
"babel-loader": "8.2.5",
"lodash-es": "4.17.21",
"tslib": "2.4.0"
Expand Down
30 changes: 21 additions & 9 deletions sources/@roots/bud-babel/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {bind} from '@roots/bud-framework/extension/decorators'
import {isUndefined} from 'lodash-es'
import {isUndefined} from '@roots/bud-support/lodash-es'

/**
* Babel transpiler options
Expand Down Expand Up @@ -90,13 +90,13 @@ export class Config {
* @decorator `@bind`
*/
@bind
public setPreset(name: string, preset: [string, any] | string): this {
if (Array.isArray(preset)) {
this.presets[name] = preset
public setPreset(name: string, preset?: [string, any] | string): this {
if (!preset) {
this.presets[name] = [name]
return this
}

this.presets[name] = [preset]
this.presets[name] = Array.isArray(preset) ? preset : [preset]
return this
}

Expand Down Expand Up @@ -173,13 +173,25 @@ export class Config {
* @decorator `@bind`
*/
@bind
public setPlugin(name: string, plugin: [any, any] | string): this {
if (Array.isArray(plugin)) {
this.plugins[name] = plugin
public setPlugin(
name: string | [any, any],
plugin?: [any, any] | string,
): this {
if (!plugin && Array.isArray(name)) {
this.plugins[name[0]] = name
return this
}

this.plugins[name] = [plugin]
if (!plugin && !Array.isArray(name)) {
this.plugins[name] = [name]
return this
}

if (Array.isArray(name)) {
throw Error(`Babel plugin name must be a string.`)
}

this.plugins[name] = Array.isArray(plugin) ? plugin : [plugin]
return this
}

Expand Down
55 changes: 15 additions & 40 deletions sources/@roots/bud-babel/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ export default class BabelExtension extends Extension {
return this.app.path()
}

/**
* Init callback
*/
@bind
public async init() {
this.app.babel = new Config()
}

/**
* Register extension
*
Expand All @@ -53,48 +61,15 @@ export default class BabelExtension extends Extension {
*/
@bind
public async register() {
this.app.babel = new Config()

this.app.babel
.setPreset(
`@babel/preset-env`,
await this.resolve(`@babel/preset-env`, import.meta.url),
)

.setPlugin(`@babel/plugin-transform-runtime`, [
await this.resolve(
`@babel/plugin-transform-runtime`,
import.meta.url,
),
{helpers: false},
])
.setPlugin(
`@babel/plugin-proposal-object-rest-spread`,
await this.resolve(
`@babel/plugin-proposal-object-rest-spread`,
import.meta.url,
),
)
.setPlugin(
`@babel/plugin-proposal-class-properties`,
await this.resolve(
`@babel/plugin-proposal-class-properties`,
import.meta.url,
),
)
.setPlugin(
`@babel/plugin-syntax-dynamic-import`,
await this.resolve(
`@babel/plugin-syntax-dynamic-import`,
import.meta.url,
),
)

const loader = await this.resolve(`babel-loader`, import.meta.url)
if (!loader) return this.logger.error(`Babel loader not found`)
.setPreset(`@babel/preset-env`)
.setPlugin([`@babel/plugin-transform-runtime`, {helpers: false}])
.setPlugin(`@babel/plugin-proposal-object-rest-spread`)
.setPlugin(`@babel/plugin-proposal-class-properties`)
.setPlugin(`@babel/plugin-syntax-dynamic-import`)

this.app.build.setLoader(`babel`, loader).setItem(`babel`, item =>
item.setLoader(`babel`).setOptions(() => ({
this.app.build.setLoader(`babel-loader`).setItem(`babel`, item =>
item.setLoader(`babel-loader`).setOptions(() => ({
cacheDirectory: this.cacheDirectory,
presets: Object.values(this.app.babel.presets),
plugins: Object.values(this.app.babel.plugins),
Expand Down
9 changes: 5 additions & 4 deletions sources/@roots/bud-babel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"rootDir": "src",
"outDir": "lib",
"types": [
"node",
"@roots/bud-framework",
"@roots/bud-api",
"node",
"@roots/bud-framework",
"@roots/bud-api",
"@roots/bud-build"
]
},
Expand All @@ -15,6 +15,7 @@
"references": [
{"path": "./../bud-framework/tsconfig.json"},
{"path": "./../bud-api/tsconfig.json"},
{"path": "./../bud-build/tsconfig.json"}
{"path": "./../bud-build/tsconfig.json"},
{"path": "./../bud-support/tsconfig.json"}
]
}
6 changes: 2 additions & 4 deletions sources/@roots/bud-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,20 @@
"@jest/globals": "29.0.1",
"@skypack/package-check": "0.2.2",
"@types/fs-extra": "9.0.13",
"@types/lodash": "4.14.185",
"@types/lodash-es": "4.17.6",
"@types/mini-css-extract-plugin": "2.5.0",
"@types/node": "16.11.48",
"webpack": "5.73.0"
},
"dependencies": {
"@roots/bud-framework": "workspace:sources/@roots/bud-framework",
"@roots/bud-support": "workspace:sources/@roots/bud-support",
"css-loader": "^6.5.1",
"csv-loader": "^3.0.3",
"file-loader": "^6.2.0",
"fs-extra": "10.1.0",
"helpful-decorators": "2.1.0",
"html-loader": "^4.0.0",
"html-loader": "^4.1.0",
"json5": "2.2.1",
"lodash-es": "4.17.21",
"mini-css-extract-plugin": "^2.4.5",
"remark": "14.0.2",
"remark-html": "15.0.1",
Expand Down
2 changes: 1 addition & 1 deletion sources/@roots/bud-build/src/item/item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {Bud} from '@roots/bud-framework/bud'
import type * as Build from '@roots/bud-framework/services/build'
import {bind} from 'helpful-decorators'
import {bind} from '@roots/bud-support/decorators'

import Base from '../shared/base.js'

Expand Down
Loading

0 comments on commit 5c5bffd

Please sign in to comment.