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
SK-Luffa authored Jul 6, 2024
2 parents 3a277ee + c72de1e commit bf38d9c
Show file tree
Hide file tree
Showing 39 changed files with 99 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: Install pnpm
if: ${{ matrix.node-version != '14.x' }}
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Get pnpm version (node 14)
if: ${{ matrix.node-version == '14.x' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compressed-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use latest LTS Node.js
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down Expand Up @@ -71,9 +71,9 @@ jobs:
run: pnpm i

- name: Build targets
run: pnpm umi-scripts turbo build
--filter ./examples/max...
--filter ./examples/test-test/...
run: pnpm umi-scripts turbo build
--filter ./examples/max...
--filter ./examples/test-test/...
--filter ./packages/umi/...

- name: e2e:example:max
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/e2e-boilerplate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down Expand Up @@ -70,10 +70,10 @@ jobs:
run: pnpm i

- name: Build targets
run: pnpm umi-scripts turbo build
--filter ./examples/create-umi-simple...
--filter ./examples/create-umi-pro/...
--filter ./examples/antd-pro-create/...
run: pnpm umi-scripts turbo build
--filter ./examples/create-umi-simple...
--filter ./examples/create-umi-pro/...
--filter ./examples/antd-pro-create/...
--filter ./packages/umi/...
--filter ./packages/max/...
--filter ./packages/preset-vue/...
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-mfsu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-qiankun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
run: pnpm i

- name: Build targets
run: pnpm umi-scripts turbo build
run: pnpm umi-scripts turbo build
--filter ./examples/max...

- name: e2e:example:qiankun:dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-vite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down
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
1 change: 1 addition & 0 deletions packages/preset-umi/src/features/mpa/extractExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export async function extractExports(opts: {
},
bundle: true,
write: false,
logLevel: 'error',
entryPoints: [`${opts.entry}?entry`],
plugins: [
{
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
Loading

0 comments on commit bf38d9c

Please sign in to comment.