umi 4.0.0-beta.7 → 4.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/forkedDev.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('v8-compile-cache');
3
+ // require('v8-compile-cache');
4
4
  require('../dist/cli/forkedDev');
package/bin/umi.js CHANGED
@@ -1,6 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('v8-compile-cache');
3
+ // disable since it's conflicted with typescript cjs + dynamic import
4
+ // require('v8-compile-cache');
5
+
6
+ // patch console for debug
7
+ // ref: https://remysharp.com/2014/05/23/where-is-that-console-log
8
+ if (process.env.DEBUG_CONSOLE) {
9
+ ['log', 'warn', 'error'].forEach((method) => {
10
+ const old = console[method];
11
+ console[method] = function () {
12
+ let stack = new Error().stack.split(/\n/);
13
+ // Chrome includes a single "Error" line, FF doesn't.
14
+ if (stack[0].indexOf('Error') === 0) {
15
+ stack = stack.slice(1);
16
+ }
17
+ const args = [].slice.apply(arguments).concat([stack[1].trim()]);
18
+ return old.apply(console, args);
19
+ };
20
+ });
21
+ }
22
+
4
23
  require('../dist/cli/cli')
5
24
  .run()
6
25
  .catch((e) => {
@@ -1,4 +1,4 @@
1
- export declare const MIN_NODE_VERSION = 14;
1
+ export declare const MIN_NODE_VERSION = 16;
2
2
  export declare const EXCLUDE_NODE_VERSION = 15;
3
3
  export declare const DEV_COMMAND = "dev";
4
4
  export declare const DEFAULT_CONFIG_FILES: string[];
package/dist/constants.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FRAMEWORK_NAME = exports.DEFAULT_CONFIG_FILES = exports.DEV_COMMAND = exports.EXCLUDE_NODE_VERSION = exports.MIN_NODE_VERSION = void 0;
4
- exports.MIN_NODE_VERSION = 14;
4
+ exports.MIN_NODE_VERSION = 16;
5
5
  exports.EXCLUDE_NODE_VERSION = 15;
6
6
  exports.DEV_COMMAND = 'dev';
7
7
  exports.DEFAULT_CONFIG_FILES = [
@@ -0,0 +1 @@
1
+ export declare function defineConfig(config: any): any;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineConfig = void 0;
4
+ function defineConfig(config) {
5
+ return config;
6
+ }
7
+ exports.defineConfig = defineConfig;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { IServicePluginAPI, PluginAPI } from '@umijs/core';
2
- import * as utils from '@umijs/utils';
3
- export declare type IApi = PluginAPI & IServicePluginAPI;
2
+ export { defineConfig } from './defineConfig';
4
3
  export * from './service/service';
5
- export { utils };
4
+ export declare type IApi = PluginAPI & IServicePluginAPI;
package/dist/index.js CHANGED
@@ -6,23 +6,11 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
6
6
  if (k2 === undefined) k2 = k;
7
7
  o[k2] = m[k];
8
8
  }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
11
  };
24
12
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.utils = void 0;
26
- const utils = __importStar(require("@umijs/utils"));
27
- exports.utils = utils;
13
+ exports.defineConfig = void 0;
14
+ var defineConfig_1 = require("./defineConfig");
15
+ Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return defineConfig_1.defineConfig; } });
28
16
  __exportStar(require("./service/service"), exports);
@@ -0,0 +1 @@
1
+ export * from '@umijs/utils';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("@umijs/utils"), exports);
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
+ export * from '@@/exports';
1
2
  export type { IApi } from '@umijs/preset-umi';
2
- export * from '@umijs/renderer-react';
3
- export * from './dist/index';
3
+ export * from './dist';
package/package.json CHANGED
@@ -1,44 +1,45 @@
1
1
  {
2
2
  "name": "umi",
3
- "version": "4.0.0-beta.7",
3
+ "version": "4.0.0-rc.2",
4
4
  "description": "umi",
5
+ "homepage": "https://github.com/umijs/umi-next/tree/master/packages/umi#readme",
6
+ "bugs": "https://github.com/umijs/umi-next/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/umijs/umi-next"
10
+ },
11
+ "license": "MIT",
5
12
  "main": "dist/index.js",
6
- "module": "index.esm.js",
7
13
  "types": "index.d.ts",
14
+ "bin": {
15
+ "umi": "bin/umi.js"
16
+ },
8
17
  "files": [
9
18
  "dist",
10
19
  "index.d.ts",
11
20
  "index.esm.js",
12
21
  "client",
13
- "bin"
22
+ "bin",
23
+ "plugin.js",
24
+ "plugin-utils.d.ts",
25
+ "plugin-utils.js"
14
26
  ],
15
- "bin": {
16
- "umi": "bin/umi.js"
17
- },
18
27
  "scripts": {
19
28
  "build": "pnpm tsc",
20
29
  "build:client": "pnpm tsc --project ./tsconfig.client.json",
21
30
  "build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
22
31
  "dev": "pnpm build -- --watch"
23
32
  },
24
- "repository": {
25
- "type": "git",
26
- "url": "https://github.com/umijs/umi-next"
33
+ "dependencies": {
34
+ "@umijs/core": "4.0.0-rc.2",
35
+ "@umijs/preset-umi": "4.0.0-rc.2",
36
+ "@umijs/renderer-react": "4.0.0-rc.2",
37
+ "@umijs/utils": "4.0.0-rc.2"
27
38
  },
28
- "authors": [
29
- "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
30
- ],
31
- "license": "MIT",
32
- "bugs": "https://github.com/umijs/umi-next/issues",
33
- "homepage": "https://github.com/umijs/umi-next/tree/master/packages/umi#readme",
34
39
  "publishConfig": {
35
40
  "access": "public"
36
41
  },
37
- "dependencies": {
38
- "@umijs/core": "4.0.0-beta.7",
39
- "@umijs/preset-umi": "4.0.0-beta.7",
40
- "@umijs/renderer-react": "4.0.0-beta.7",
41
- "@umijs/utils": "4.0.0-beta.7",
42
- "v8-compile-cache": "2.3.0"
43
- }
42
+ "authors": [
43
+ "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
44
+ ]
44
45
  }
@@ -0,0 +1 @@
1
+ export type * from './dist/pluginUtils';
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/pluginUtils');
package/plugin.js ADDED
@@ -0,0 +1 @@
1
+ export { getPluginManager } from '@@/core/plugin';
package/index.esm.js DELETED
@@ -1,2 +0,0 @@
1
- export { Link, Outlet } from '@umijs/renderer-react';
2
- export { PluginManager } from './client/client/plugin';