Skip to content

Commit

Permalink
feat: upgrade to pnpm v7
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni committed Jun 28, 2022
1 parent 133d3ff commit 19ee2da
Show file tree
Hide file tree
Showing 61 changed files with 3,102 additions and 1,187 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
/packages/**/src/**/fixtures/*/.umi-production
.umi
.umi-production
dist
dist
.turbo
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
registry=https://registry.npmjs.org/
strict-peer-dependencies=false
30 changes: 25 additions & 5 deletions examples/boilerplate/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import ListGary from '@/assets/demoIcon/list.png';
import ListBlue from '@/assets/demoIcon/list1.png';
import SetGary from '@/assets/demoIcon/setting.png';
import SetBlue from '@/assets/demoIcon/setting1.png';
import type {
NavBarListItem,
NavBarProps,
TabBarListItem,
TabBarProps,
TitleListItem,
} from 'alita';

export const request = {
prefix: '/api',
Expand All @@ -15,7 +22,7 @@ export const request = {
},
};

const titleList = [
const titleList: TitleListItem[] = [
{
pagePath: '/',
title: '首页',
Expand All @@ -29,15 +36,28 @@ const titleList = [
title: '设置',
},
];
const navList = [];
const navBar = {
const navList: NavBarListItem[] = [
{
pagePath: '/',
navBar: {
pageBackground: '#fff',
},
},
{
pagePath: '/users',
navBar: {
pageBackground: '#000',
},
},
];
const navBar: NavBarProps = {
navList,
fixed: false,
onLeftClick: () => {
// router.goBack();
},
};
const tabList = [
const tabList: TabBarListItem[] = [
{
pagePath: '/',
text: '首页',
Expand Down Expand Up @@ -67,7 +87,7 @@ const tabList = [
},
];

const tabBar = {
const tabBar: TabBarProps = {
color: `#999999`,
selectedColor: '#00A0FF',
borderStyle: 'white',
Expand Down
19 changes: 0 additions & 19 deletions jest.config.ts

This file was deleted.

113 changes: 68 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,86 @@
"private": true,
"version": "3.0.0-alpha.1",
"scripts": {
"bootstrap": "esno scripts/bootstrap.ts",
"build": "pnpm -r --filter ./packages run build",
"build:release": "pnpm -r --filter ./packages run build -- --declarationMap false",
"dep:update": "esno scripts/checkNpmClient.ts && pnpm up --interactive --latest --recursive",
"dev": "pnpm -r --filter ./packages --parallel run dev",
"doc:build": "umi build",
"bootstrap": "umi-scripts bootstrap",
"build": "umi-scripts turbo --cmd build",
"build:client": "umi-scripts turbo --cmd build:client",
"build:extra": "umi-scripts turbo --cmd build:extra",
"build:force": "umi-scripts turbo --cmd build --no-cache",
"build:release": "umi-scripts turbo --cmd build --no-cache -- --declarationMap false",
"check:packageFiles": "umi-scripts checkPackageFiles",
"cov": "jest --coverage",
"dep:update": "pnpm up --interactive --latest --recursive",
"dev": "umi-scripts turbo --cmd dev --parallel",
"doc:build": "pnpm doc:deps && umi build",
"doc:deps": "pnpm doc:deps-ts && pnpm doc:deps-extra",
"doc:deps-extra": "umi-scripts turbo --cmd build:extra --filter @umijs/plugin-docs...",
"doc:deps-ts": "umi-scripts turbo --cmd build --filter @umijs/plugin-docs...",
"doc:dev": "umi dev",
"format": "prettier --write .",
"preinstall": "esno scripts/checkNpmClient.ts",
"format:docs": "prettier 'docs/**/*.{md,mdx}' --write --ignore-path .gitignore --ignore-unknown",
"format:plugin-docs": "prettier 'packages/plugin-docs/**/*' --write --ignore-unknown",
"preinstall": "npx only-allow pnpm",
"postinstall": "umi-scripts postinstall",
"jest": "jest",
"prepare": "husky install",
"release": "umi-scripts release",
"setup:webstorm": "umi-scripts setupWebStorm",
"sync:tnpm": "umi-scripts syncTnpm",
"test": "jest",
"test:clean": "jest --clearCache",
"test:clean": "umi-scripts turbo --cmd test --no-cache --parallel -- --clearCache",
"test:e2e": "jest --config jest.e2e.config.ts",
"tsc:check": "tsc --noEmit",
"prereleases": "changeset pre enter beta",
"prereleases:exit": "changeset pre exit && changeset version",
"turbo:clean": "rimraf .turbo",
"changeset": "esno scripts/changeset.ts",
"version-packages": "changeset version",
"release": "pnpm build && pnpm release:only",
"release:only": "changeset publish --registry=https://registry.npmjs.com/"
"version-packages": "changeset version"
},
"devDependencies": {
"@types/qrcode-terminal": "*",
"@types/rimraf": "3.0.2",
"umi": "4.0.1",
"@umijs/utils": "4.0.1",
"@umijs/plugin-docs": "4.0.1",
"@changesets/cli": "^2.23.0",
"@changesets/changelog-github": "^0.4.5",
"esno": "^0.10.1",
"husky": "^7.0.4",
"jest": "^27.3.1",
"lerna": "^4.0.0",
"resolve": "^1.20.0",
"rimraf": "^3.0.2",
"ts-node": "^10.4.0",
"typescript": "^4.5.0-beta",
"uglify-js": "^3.14.2",
"yorkie": "^2.0.0",
"zx": "^4.2.0",
"@changesets/cli": "^2.23.0",
"@manypkg/get-packages": "^1.1.3",
"@types/qrcode-terminal": "*",
"@umijs/plugin-docs": "4.0.0-canary.20220628.2",
"@umijs/utils": "4.0.0-canary.20220628.2",
"core-js": "3.19.2",
"@types/jest": "^27.0.2",
"@types/node": "^16.11.6",
"@types/react": "^17.0.33",
"@types/react-dom": "^17.0.10",
"@types/resolve": "^1.20.1",
"@vercel/ncc": "^0.31.1",
"dts-packer": "^0.0.2",
"esbuild-jest": "^0.5.0",
"umi": "4.0.0-canary.20220628.2",
"yorkie": "^2.0.0",
"@pnpm/lockfile-file": "^5.0.3",
"@pnpm/logger": "^4.0.0",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.35",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.5",
"@types/resolve": "^1.20.2",
"@types/rimraf": "3.0.2",
"@vercel/ncc": "0.33.3",
"dts-packer": "^0.0.3",
"esno": "^0.14.1",
"expect-playwright": "^0.8.0",
"git-repo-info": "^2.1.1",
"lint-staged": "^11.2.3",
"prettier": "^2.5.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"jest-playwright-preset": "^1.7.0",
"lint-staged": "^12.3.7",
"matcher": "^5.0.0",
"only-allow": "^1.1.0",
"playwright-chromium": "^1.20.2",
"prettier": "^2.6.2",
"prettier-plugin-organize-imports": "^2.3.4",
"prettier-plugin-packagejson": "^2.2.15",
"prettier-plugin-packagejson": "^2.2.17",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-text-loop-next": "0.0.3",
"regenerator-runtime": "^0.13.9",
"@manypkg/get-packages": "^1.1.3"
"resolve": "^1.22.0",
"rimraf": "^3.0.2",
"ts-node": "^10.7.0",
"turbo": "^1.3.1",
"typescript": "^4.7.2",
"uglify-js": "^3.15.4",
"umi-scripts": "workspace:*",
"zx": "^4.3.0"
},
"gitHooks": {
"pre-commit": "lint-staged",
Expand All @@ -70,11 +95,9 @@
"prettier --parser=typescript --write"
]
},
"packageManager": "pnpm@6.32.0",
"packageManager": "pnpm@7.3.0",
"engines": {
"node": ">=14",
"pnpm": ">=6.20",
"npm": "not use",
"yarn": "not use"
"pnpm": ">=6.20.0"
}
}
13 changes: 7 additions & 6 deletions packages/alita/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scripts": {
"build": "pnpm tsc",
"build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
"dev": "pnpm build -- --watch"
"dev": "pnpm build --watch"
},
"repository": {
"type": "git",
Expand All @@ -34,14 +34,15 @@
"alita": "bin/alita.js"
},
"dependencies": {
"@alita/types": "3.0.0",
"@alita/native": "3.0.3",
"@alita/plugins": "3.0.3",
"@umijs/bundler-utils": "4.0.1",
"@umijs/core": "4.0.1",
"@umijs/renderer-react": "4.0.1",
"@umijs/utils": "4.0.1",
"@umijs/bundler-utils": "4.0.0-canary.20220628.2",
"@umijs/core": "4.0.0-canary.20220628.2",
"@umijs/renderer-react": "4.0.0-canary.20220628.2",
"@umijs/utils": "4.0.0-canary.20220628.2",
"qrcode-terminal": "^0.12.0",
"umi": "4.0.1",
"umi": "4.0.0-canary.20220628.2",
"v8-compile-cache": "^2.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/alita/src/features/config/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Root } from '@umijs/core/compiled/@hapi/joi';
import type { Root } from '@umijs/utils/compiled/@hapi/joi';

export function getSchemas(): Record<string, (Joi: Root) => any> {
// 这是一些只有配置没有功能的设置,可能是配置项会在多个插件中使用
Expand Down
4 changes: 2 additions & 2 deletions packages/alita/src/features/nodeModulesTransform.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AlitaApi } from '../types';
import { IApi } from 'umi';

export default (api: AlitaApi) => {
export default (api: IApi) => {
// nodeModulesTransform
api.describe({
key: 'nodeModulesTransform',
Expand Down
2 changes: 1 addition & 1 deletion packages/alita/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// @ts-ignore
export * from '@alita/types';
export * from 'umi';
export type { AlitaApi } from './types';
2 changes: 1 addition & 1 deletion packages/chalk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"build": "pnpm tsc",
"build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
"dev": "pnpm build -- --watch"
"dev": "pnpm build --watch"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/create-alita/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"build": "pnpm tsc",
"build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
"dev": "pnpm build -- --watch"
"dev": "pnpm build --watch"
},
"repository": {
"type": "git",
Expand All @@ -30,6 +30,6 @@
"create-alita": "bin/create-alita.js"
},
"dependencies": {
"@umijs/utils": "4.0.1"
"@umijs/utils": "4.0.0-canary.20220628.2"
}
}
5 changes: 4 additions & 1 deletion packages/flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"build": "pnpm tsc",
"build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
"dev": "pnpm build -- --watch"
"dev": "pnpm build --watch"
},
"repository": {
"type": "git",
Expand All @@ -28,5 +28,8 @@
"dependencies": {
"@sentry/browser": "^6.16.1",
"hoist-non-react-statics": "^3.3.2"
},
"devDependencies": {
"@types/hoist-non-react-statics": "^3.3.1"
}
}
4 changes: 4 additions & 0 deletions packages/flow/src/components/ErrorBoundary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class ErrorBoundary extends React.Component<
};

public render(): React.ReactNode {
// @ts-ignore
const { fallback, children } = this.props;
const { error, componentStack, eventId } = this.state;

Expand Down Expand Up @@ -179,7 +180,9 @@ function withErrorBoundary<P extends Record<string, any>>(
WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;

const Wrapped: React.FC<P> = (props: P) => (
// @ts-ignore
<ErrorBoundary {...errorBoundaryOptions}>
{/* @ts-ignore */}
<WrappedComponent {...props} />
</ErrorBoundary>
);
Expand All @@ -189,6 +192,7 @@ function withErrorBoundary<P extends Record<string, any>>(

// Copy over static methods from Wrapped component to Profiler HOC
// See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over
// @ts-ignore
hoistNonReactStatics(Wrapped, WrappedComponent);
return Wrapped;
}
Expand Down
1 change: 1 addition & 0 deletions packages/flow/src/components/FillContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const FillContainer: React.FC<FillContainerProps> = (props) => {
backgroundColor = '',
flexDirection = 'column',
overflow = 'hidden',
// @ts-ignore
children,
classname = '',
} = props;
Expand Down
1 change: 1 addition & 0 deletions packages/flow/src/components/FlexContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const FlexContent: React.FC<FlexContentProps> = (props) => {
backgroundColor = '',
flexDirection = 'column',
overflow = 'scroll',
// @ts-ignore
children,
classname = '',
} = props;
Expand Down
1 change: 1 addition & 0 deletions packages/flow/src/components/ShrinkingModule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const ShrinkingModule: React.FC<ShrinkingModuleProps> = (props) => {
backgroundColor = '',
flexDirection = 'column',
overflow = 'hidden',
// @ts-ignore
children,
classname = '',
} = props;
Expand Down
Loading

0 comments on commit 19ee2da

Please sign in to comment.