From db9bfa75765dbbc222beed10715fa06d7d6c6840 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 31 May 2023 17:37:14 +0800 Subject: [PATCH] build --- package-lock.json | 20 ++-- src/.umi/core/devScripts.ts | 51 --------- src/.umi/core/history.ts | 26 ----- src/.umi/core/plugin.ts | 8 -- src/.umi/core/pluginConfig.d.ts | 180 -------------------------------- src/.umi/core/pluginRegister.ts | 8 -- src/.umi/core/polyfill.ts | 3 - src/.umi/core/routes.ts | 16 --- src/.umi/core/umiExports.ts | 3 - src/.umi/umi.ts | 58 ---------- 10 files changed, 10 insertions(+), 363 deletions(-) delete mode 100644 src/.umi/core/devScripts.ts delete mode 100644 src/.umi/core/history.ts delete mode 100644 src/.umi/core/plugin.ts delete mode 100644 src/.umi/core/pluginConfig.d.ts delete mode 100644 src/.umi/core/pluginRegister.ts delete mode 100644 src/.umi/core/polyfill.ts delete mode 100644 src/.umi/core/routes.ts delete mode 100644 src/.umi/core/umiExports.ts delete mode 100644 src/.umi/umi.ts diff --git a/package-lock.json b/package-lock.json index 7ebd5369..3bc0f820 100644 --- a/package-lock.json +++ b/package-lock.json @@ -695,7 +695,7 @@ }, "abbrev": { "version": "1.1.1", - "resolved": "http://173.15.15.82:8081/repository/npm-all/abbrev/-/abbrev-1.1.1.tgz", + "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, @@ -7471,7 +7471,7 @@ }, "fstream": { "version": "1.0.12", - "resolved": "http://173.15.15.82:8081/repository/npm-all/fstream/-/fstream-1.0.12.tgz", + "resolved": "https://registry.npmmirror.com/fstream/-/fstream-1.0.12.tgz", "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", "dev": true, "requires": { @@ -7531,7 +7531,7 @@ }, "gaze": { "version": "1.1.3", - "resolved": "http://173.15.15.82:8081/repository/npm-all/gaze/-/gaze-1.1.3.tgz", + "resolved": "https://registry.npmmirror.com/gaze/-/gaze-1.1.3.tgz", "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", "dev": true, "requires": { @@ -8679,7 +8679,7 @@ }, "in-publish": { "version": "2.0.1", - "resolved": "http://173.15.15.82:8081/repository/npm-all/in-publish/-/in-publish-2.0.1.tgz", + "resolved": "https://registry.npmmirror.com/in-publish/-/in-publish-2.0.1.tgz", "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==", "dev": true }, @@ -10848,7 +10848,7 @@ }, "node-gyp": { "version": "3.8.0", - "resolved": "http://173.15.15.82:8081/repository/npm-all/node-gyp/-/node-gyp-3.8.0.tgz", + "resolved": "https://registry.npmmirror.com/node-gyp/-/node-gyp-3.8.0.tgz", "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", "dev": true, "requires": { @@ -11042,7 +11042,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "http://173.15.15.82:8081/repository/npm-all/npmlog/-/npmlog-4.1.2.tgz", + "resolved": "https://registry.npmmirror.com/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "requires": { @@ -11350,7 +11350,7 @@ }, "osenv": { "version": "0.1.5", - "resolved": "http://173.15.15.82:8081/repository/npm-all/osenv/-/osenv-0.1.5.tgz", + "resolved": "https://registry.npmmirror.com/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "requires": { @@ -17226,7 +17226,7 @@ }, "stdout-stream": { "version": "1.4.1", - "resolved": "http://173.15.15.82:8081/repository/npm-all/stdout-stream/-/stdout-stream-1.4.1.tgz", + "resolved": "https://registry.npmmirror.com/stdout-stream/-/stdout-stream-1.4.1.tgz", "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", "dev": true, "requires": { @@ -17772,7 +17772,7 @@ }, "tar": { "version": "2.2.2", - "resolved": "http://173.15.15.82:8081/repository/npm-all/tar/-/tar-2.2.2.tgz", + "resolved": "https://registry.npmmirror.com/tar/-/tar-2.2.2.tgz", "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", "dev": true, "requires": { @@ -18179,7 +18179,7 @@ }, "true-case-path": { "version": "1.0.3", - "resolved": "http://173.15.15.82:8081/repository/npm-all/true-case-path/-/true-case-path-1.0.3.tgz", + "resolved": "https://registry.npmmirror.com/true-case-path/-/true-case-path-1.0.3.tgz", "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", "dev": true, "requires": { diff --git a/src/.umi/core/devScripts.ts b/src/.umi/core/devScripts.ts deleted file mode 100644 index b4e80d16..00000000 --- a/src/.umi/core/devScripts.ts +++ /dev/null @@ -1,51 +0,0 @@ -// @ts-nocheck - -if (window.g_initWebpackHotDevClient) { - function tryApplyUpdates(onHotUpdateSuccess?: Function) { - // @ts-ignore - if (!module.hot) { - window.location.reload(); - return; - } - - function isUpdateAvailable() { - // @ts-ignore - return window.g_getMostRecentCompilationHash() !== __webpack_hash__; - } - - // TODO: is update available? - // @ts-ignore - if (!isUpdateAvailable() || module.hot.status() !== 'idle') { - return; - } - - function handleApplyUpdates(err: Error | null, updatedModules: any) { - if (err || !updatedModules || window.g_getHadRuntimeError()) { - window.location.reload(); - return; - } - - onHotUpdateSuccess?.(); - - if (isUpdateAvailable()) { - // While we were updating, there was a new update! Do it again. - tryApplyUpdates(); - } - } - - // @ts-ignore - module.hot.check(true).then( - function (updatedModules: any) { - handleApplyUpdates(null, updatedModules); - }, - function (err: Error) { - handleApplyUpdates(err, null); - }, - ); - } - - window.g_initWebpackHotDevClient({ - tryApplyUpdates, - }); -} - \ No newline at end of file diff --git a/src/.umi/core/history.ts b/src/.umi/core/history.ts deleted file mode 100644 index 11580d04..00000000 --- a/src/.umi/core/history.ts +++ /dev/null @@ -1,26 +0,0 @@ -// @ts-nocheck -import { createBrowserHistory } from '/Users/caishi/forgeplus-react/node_modules/@umijs/runtime'; - -let options = { - "basename": "/" -}; -if ((window).routerBase) { - options.basename = (window).routerBase; -} - -// remove initial history because of ssr -let history: any = process.env.__IS_SERVER ? null : createBrowserHistory(options); -export const createHistory = (hotReload = false) => { - if (!hotReload) { - history = createBrowserHistory(options); - } - - return history; -}; - -// 通常仅微前端场景需要调用这个 API -export const setCreateHistoryOptions = (newOpts: any = {}) => { - options = { ...options, ...newOpts }; -}; - -export { history }; diff --git a/src/.umi/core/plugin.ts b/src/.umi/core/plugin.ts deleted file mode 100644 index 8a2a84aa..00000000 --- a/src/.umi/core/plugin.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @ts-nocheck -import { Plugin } from '/Users/caishi/forgeplus-react/node_modules/@umijs/runtime'; - -const plugin = new Plugin({ - validKeys: ['modifyClientRenderOpts','patchRoutes','rootContainer','render','onRouteChange',], -}); - -export { plugin }; diff --git a/src/.umi/core/pluginConfig.d.ts b/src/.umi/core/pluginConfig.d.ts deleted file mode 100644 index f5accc3d..00000000 --- a/src/.umi/core/pluginConfig.d.ts +++ /dev/null @@ -1,180 +0,0 @@ -/** Created by Umi Plugin **/ - -export interface IConfigFromPlugins { - routes?: { - /** - * Any valid URL path - */ - path?: string; - /** - * A React component to render only when the location matches. - */ - component?: string | (() => any); - wrappers?: string[]; - /** - * navigate to a new location - */ - redirect?: string; - /** - * When true, the active class/style will only be applied if the location is matched exactly. - */ - exact?: boolean; - routes?: any[]; - [k: string]: any; - }[]; - history?: { - type?: "browser" | "hash" | "memory"; - options?: {}; - }; - polyfill?: { - imports?: string[]; - }; - alias?: {}; - analyze?: { - analyzerMode?: "server" | "static" | "disabled"; - analyzerHost?: string; - analyzerPort?: any; - openAnalyzer?: boolean; - generateStatsFile?: boolean; - statsFilename?: string; - logLevel?: "info" | "warn" | "error" | "silent"; - defaultSizes?: "stat" | "parsed" | "gzip"; - [k: string]: any; - }; - /** - * postcss autoprefixer, default flexbox: no-2009 - */ - autoprefixer?: {}; - base?: string; - chainWebpack?: () => any; - chunks?: string[]; - /** - * more css-loader options see https://webpack.js.org/loaders/css-loader/#options - */ - cssLoader?: { - url?: boolean | (() => any); - import?: boolean | (() => any); - modules?: boolean | string | {}; - sourceMap?: boolean; - importLoaders?: number; - onlyLocals?: boolean; - esModule?: boolean; - localsConvention?: "asIs" | "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly"; - }; - cssModulesTypescriptLoader?: { - mode?: "emit" | "verify"; - }; - cssnano?: {}; - copy?: string[]; - define?: {}; - devScripts?: {}; - /** - * devServer configs - */ - devServer?: { - /** - * devServer port, default 8000 - */ - port?: number; - host?: string; - https?: - | { - key?: string; - cert?: string; - [k: string]: any; - } - | boolean; - headers?: {}; - writeToDisk?: boolean | (() => any); - [k: string]: any; - }; - devtool?: string; - /** - * Code splitting for performance optimization - */ - dynamicImport?: { - /** - * loading the component before loaded - */ - loading?: string; - }; - exportStatic?: { - htmlSuffix?: boolean; - dynamicRoot?: boolean; - /** - * extra render paths only enable in ssr - */ - extraRoutePaths?: () => any; - }; - externals?: {} | string | (() => any); - extraBabelPlugins?: any[]; - extraBabelPresets?: any[]; - extraPostCSSPlugins?: any[]; - /** - * fork-ts-checker-webpack-plugin options see https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#options - */ - forkTSChecker?: { - async?: boolean; - typescript?: boolean | {}; - eslint?: {}; - issue?: {}; - formatter?: string | {}; - logger?: {}; - [k: string]: any; - }; - hash?: boolean; - ignoreMomentLocale?: boolean; - inlineLimit?: number; - lessLoader?: {}; - manifest?: { - fileName?: string; - publicPath?: ""; - basePath?: string; - writeToFileEmit?: boolean; - }; - mountElementId?: ""; - mpa?: {}; - nodeModulesTransform?: { - type?: "all" | "none"; - exclude?: string[]; - }; - outputPath?: ""; - plugins?: string[]; - postcssLoader?: {}; - presets?: string[]; - proxy?: {}; - publicPath?: string; - runtimePublicPath?: boolean; - ssr?: { - /** - * remove window.g_initialProps in html, to force execing Page getInitialProps functions - */ - forceInitial?: boolean; - /** - * disable serve-side render in umi dev mode. - */ - devServerRender?: boolean; - mode?: "stream" | "string"; - /** - * static markup in static site - */ - staticMarkup?: boolean; - }; - singular?: boolean; - styleLoader?: {}; - targets?: {}; - terserOptions?: {}; - theme?: {}; - runtimeHistory?: {}; - favicon?: string; - headScripts?: any[]; - links?: any[]; - metas?: any[]; - scripts?: any[]; - styles?: any[]; - title?: string; - mock?: { - exclude?: string[]; - }; - [k: string]: any; -} diff --git a/src/.umi/core/pluginRegister.ts b/src/.umi/core/pluginRegister.ts deleted file mode 100644 index 849d5441..00000000 --- a/src/.umi/core/pluginRegister.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @ts-nocheck -import { plugin } from './plugin'; -import * as Plugin_0 from '/Users/caishi/forgeplus-react/src/app.js'; - - plugin.register({ - apply: Plugin_0, - path: '/Users/caishi/forgeplus-react/src/app.js', - }); diff --git a/src/.umi/core/polyfill.ts b/src/.umi/core/polyfill.ts deleted file mode 100644 index 5ff6c3d6..00000000 --- a/src/.umi/core/polyfill.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @ts-nocheck -import 'core-js'; -import 'regenerator-runtime/runtime'; diff --git a/src/.umi/core/routes.ts b/src/.umi/core/routes.ts deleted file mode 100644 index b239a99c..00000000 --- a/src/.umi/core/routes.ts +++ /dev/null @@ -1,16 +0,0 @@ -// @ts-nocheck -import { ApplyPluginsType } from '/Users/caishi/forgeplus-react/node_modules/@umijs/runtime'; -import { plugin } from './plugin'; - -export function getRoutes() { - const routes = []; - - // allow user to extend routes - plugin.applyPlugins({ - key: 'patchRoutes', - type: ApplyPluginsType.event, - args: { routes }, - }); - - return routes; -} diff --git a/src/.umi/core/umiExports.ts b/src/.umi/core/umiExports.ts deleted file mode 100644 index 8135e51b..00000000 --- a/src/.umi/core/umiExports.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @ts-nocheck -export { history, setCreateHistoryOptions } from './history'; -export { plugin } from './plugin'; diff --git a/src/.umi/umi.ts b/src/.umi/umi.ts deleted file mode 100644 index d581cc34..00000000 --- a/src/.umi/umi.ts +++ /dev/null @@ -1,58 +0,0 @@ -// @ts-nocheck -import './core/polyfill'; -import '@@/core/devScripts'; -import { plugin } from './core/plugin'; -import './core/pluginRegister'; -import { createHistory } from './core/history'; -import { ApplyPluginsType } from '/Users/caishi/forgeplus-react/node_modules/@umijs/runtime'; -import { renderClient } from '/Users/caishi/forgeplus-react/node_modules/@umijs/renderer-react/dist/index.js'; -import { getRoutes } from './core/routes'; - - - - -const getClientRender = (args: { hot?: boolean; routes?: any[] } = {}) => plugin.applyPlugins({ - key: 'render', - type: ApplyPluginsType.compose, - initialValue: () => { - const opts = plugin.applyPlugins({ - key: 'modifyClientRenderOpts', - type: ApplyPluginsType.modify, - initialValue: { - routes: args.routes || getRoutes(), - plugin, - history: createHistory(args.hot), - isServer: process.env.__IS_SERVER, - rootElement: 'root', - defaultTitle: ``, - }, - }); - return renderClient(opts); - }, - args, -}); - -const clientRender = getClientRender(); -export default clientRender(); - - - window.g_umi = { - version: '3.2.17', - }; - - -// hot module replacement -// @ts-ignore -if (module.hot) { - // @ts-ignore - module.hot.accept('./core/routes', () => { - const ret = require('./core/routes'); - if (ret.then) { - ret.then(({ getRoutes }) => { - getClientRender({ hot: true, routes: getRoutes() })(); - }); - } else { - getClientRender({ hot: true, routes: ret.getRoutes() })(); - } - }); -}