Skip to content

Commit

Permalink
Merge branch 'umijs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Redish101 authored Jul 4, 2024
2 parents 8e6eada + c0da93f commit 6ba879a
Show file tree
Hide file tree
Showing 29 changed files with 80 additions and 72 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.3.0",
"version": "4.3.1",
"workspaces": ["packages/*"]
}
2 changes: 1 addition & 1 deletion packages/ast/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/ast",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/ast",
"homepage": "https://github.com/umijs/umi/tree/master/packages/ast#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-umi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/babel-preset-umi",
"version": "4.3.0",
"version": "4.3.1",
"description": "Official babel preset for umi.",
"homepage": "https://github.com/umijs/umi/tree/master/packages/babel-preset-umi#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-esbuild/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/bundler-esbuild",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/bundler-esbuild",
"homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-esbuild#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/bundler-utils",
"version": "4.3.0",
"version": "4.3.1",
"homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-utils#readme",
"bugs": "https://github.com/umijs/umi/issues",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/bundler-vite",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/bundler-vite",
"homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-vite#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/bundler-webpack",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/bundler-webpack",
"homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-webpack#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/core",
"version": "4.3.0",
"version": "4.3.1",
"homepage": "https://github.com/umijs/umi/tree/master/packages/core#readme",
"bugs": "https://github.com/umijs/umi/issues",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-umi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-umi",
"version": "4.3.0",
"version": "4.3.1",
"description": "create-umi",
"homepage": "https://github.com/umijs/umi/tree/master/packages/create-umi#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/lint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/lint",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/lint",
"homepage": "https://github.com/umijs/umi/tree/master/packages/lint#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/max/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/max",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/max",
"homepage": "https://github.com/umijs/umi/tree/master/packages/max#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/mfsu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/mfsu",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/mfsu",
"homepage": "https://github.com/umijs/umi/tree/master/packages/mfsu#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/plugin-docs",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/plugin-docs",
"homepage": "https://github.com/umijs/umi/tree/master/packages/plugin-docs#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-run/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/plugin-run",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/plugin-run",
"homepage": "https://github.com/umijs/umi/tree/master/packages/plugin-run#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/plugins",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/plugins",
"homepage": "https://github.com/umijs/umi/tree/master/packages/plugins#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
4 changes: 2 additions & 2 deletions packages/preset-umi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/preset-umi",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/preset-umi",
"homepage": "https://github.com/umijs/umi/tree/master/packages/preset-umi#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down Expand Up @@ -30,7 +30,7 @@
"@umijs/ast": "workspace:*",
"@umijs/babel-preset-umi": "workspace:*",
"@umijs/bundler-esbuild": "workspace:*",
"@umijs/bundler-mako": "0.7.3",
"@umijs/bundler-mako": "0.7.4",
"@umijs/bundler-utils": "workspace:*",
"@umijs/bundler-vite": "workspace:*",
"@umijs/bundler-webpack": "workspace:*",
Expand Down
15 changes: 1 addition & 14 deletions packages/preset-umi/src/features/configPlugins/configPlugins.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import { getSchemas as getViteSchemas } from '@umijs/bundler-vite/dist/schema';
import { getSchemas as getWebpackSchemas } from '@umijs/bundler-webpack/dist/schema';
import { resolve } from '@umijs/utils';
import { dirname, join } from 'path';
import type { IApi } from '../../types';
import { resolveProjectDep } from '../../utils/resolveProjectDep';
import { getSchemas as getExtraSchemas } from './schema';

function resolveProjectDep(opts: { pkg: any; cwd: string; dep: string }) {
if (
opts.pkg.dependencies?.[opts.dep] ||
opts.pkg.devDependencies?.[opts.dep]
) {
return dirname(
resolve.sync(`${opts.dep}/package.json`, {
basedir: opts.cwd,
}),
);
}
}

export default (api: IApi) => {
const { userConfig } = api;
const reactDOMPath =
Expand Down
15 changes: 14 additions & 1 deletion packages/preset-umi/src/features/forget/forget.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { dirname } from 'path';
import { IApi } from '../../types';
import { resolveProjectDep } from '../../utils/resolveProjectDep';

export default (api: IApi) => {
api.describe({
Expand Down Expand Up @@ -35,13 +37,24 @@ export default (api: IApi) => {
}
});

const BABEL_PLUGIN_NAME = `babel-plugin-react-compiler`;
let libPath: string;
try {
libPath =
resolveProjectDep({
pkg: api.pkg,
cwd: api.cwd,
dep: BABEL_PLUGIN_NAME,
}) || dirname(require.resolve(`${BABEL_PLUGIN_NAME}/package.json`));
} catch (e) {}

api.modifyConfig((memo) => {
let ReactCompilerConfig = api.userConfig.forget.ReactCompilerConfig || {};
return {
...memo,
extraBabelPlugins: [
...(memo.extraBabelPlugins || []),
[require.resolve('babel-plugin-react-compiler'), ReactCompilerConfig],
[libPath, ReactCompilerConfig],
],
};
});
Expand Down
9 changes: 2 additions & 7 deletions packages/preset-umi/src/features/mako/mako.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { chalk } from '@umijs/utils';
import path from 'path';
import { IApi } from '../../types';
import { isWindows } from '../../utils/platform';
Expand Down Expand Up @@ -50,12 +49,8 @@ export default (api: IApi) => {
api.logger.info(`Using mako@${pkg.version}`);
const isBigfish = process.env.BIGFISH_INFO;
if (!isBigfish) {
api.logger.warn(
chalk.yellow(
chalk.bold(
`Mako is an extremely fast, production-grade web bundler based on Rust. And it's still under active development and is not yet ready for production use. If you encounter any issues, please checkout https://makojs.dev/ to join the community and report the issue.`,
),
),
api.logger.info(
`Mako is an extremely fast, production-grade web bundler based on Rust. If you encounter any issues, please checkout https://makojs.dev/ to join the community and report the issue.`,
);
}
} catch (e) {
Expand Down
19 changes: 19 additions & 0 deletions packages/preset-umi/src/utils/resolveProjectDep.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { resolve } from '@umijs/utils';
import { dirname } from 'path';

export function resolveProjectDep(opts: {
pkg: any;
cwd: string;
dep: string;
}) {
if (
opts.pkg.dependencies?.[opts.dep] ||
opts.pkg.devDependencies?.[opts.dep]
) {
return dirname(
resolve.sync(`${opts.dep}/package.json`, {
basedir: opts.cwd,
}),
);
}
}
2 changes: 1 addition & 1 deletion packages/preset-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/preset-vue",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/preset-vue",
"homepage": "https://github.com/umijs/umi/tree/master/packages/preset-vue#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/renderer-react",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/renderer-react",
"homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-react#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/renderer-vue",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/renderer-vue",
"homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-vue#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/server",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/server",
"homepage": "https://github.com/umijs/umi/tree/master/packages/server#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/test",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/test",
"homepage": "https://github.com/umijs/umi/tree/master/packages/testing#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/umi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "umi",
"version": "4.3.0",
"version": "4.3.1",
"description": "umi",
"homepage": "https://github.com/umijs/umi/tree/master/packages/umi#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/utils",
"version": "4.3.0",
"version": "4.3.1",
"homepage": "https://github.com/umijs/umi/tree/master/packages/utils#readme",
"bugs": "https://github.com/umijs/umi/issues",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/zod2ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umijs/zod2ts",
"version": "4.3.0",
"version": "4.3.1",
"description": "@umijs/zod2ts",
"homepage": "https://github.com/umijs/umi/tree/master/packages/zod2ts#readme",
"bugs": "https://github.com/umijs/umi/issues",
Expand Down
Loading

0 comments on commit 6ba879a

Please sign in to comment.