@shuvi/platform-shared 1.0.0-rc.12 → 1.0.0-rc.13

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.
@@ -1,7 +1,6 @@
1
1
  import { IRuntimeConfig } from '../../../../shared';
2
2
  export declare const extendedHooks: {
3
3
  addEntryCode: import("@shuvi/hook").AsyncParallelHook<void, void, string | string[]>;
4
- addPolyfill: import("@shuvi/hook").AsyncParallelHook<void, void, string | string[]>;
5
4
  modifyRuntimeConfig: import("@shuvi/hook").AsyncSeriesWaterfallHook<{
6
5
  public: IRuntimeConfig;
7
6
  server: IRuntimeConfig;
@@ -3,10 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extendedHooks = void 0;
4
4
  const hook_1 = require("@shuvi/hook");
5
5
  const addEntryCode = (0, hook_1.createAsyncParallelHook)();
6
- const addPolyfill = (0, hook_1.createAsyncParallelHook)();
7
6
  const modifyRuntimeConfig = (0, hook_1.createAsyncSeriesWaterfallHook)();
8
7
  exports.extendedHooks = {
9
8
  addEntryCode,
10
- addPolyfill,
11
9
  modifyRuntimeConfig
12
10
  };
@@ -4,4 +4,4 @@ import { IPluginContext } from '@shuvi/service';
4
4
  * `core/error`, `core/platform`, `core/plugins`, `core/polyfill`, `core/runtimeConfig`, `core/setRuntimeConfig`,
5
5
  * `user/error`, `user/runtime` and `entry`
6
6
  */
7
- export declare const getPresetRuntimeFilesCreator: (platformModule: string, polyfills: string[]) => (pluginContext: IPluginContext) => Promise<import("@shuvi/service/lib/project").FileOption<any, any>[]>;
7
+ export declare const getPresetRuntimeFilesCreator: (platformModule: string) => (pluginContext: IPluginContext) => Promise<import("@shuvi/service/lib/project").FileOption<any, any>[]>;
@@ -19,7 +19,7 @@ const file_presets_1 = require("../project/file-presets");
19
19
  * `core/error`, `core/platform`, `core/plugins`, `core/polyfill`, `core/runtimeConfig`, `core/setRuntimeConfig`,
20
20
  * `user/error`, `user/runtime` and `entry`
21
21
  */
22
- const getPresetRuntimeFilesCreator = (platformModule, polyfills) => (pluginContext) => __awaiter(void 0, void 0, void 0, function* () {
22
+ const getPresetRuntimeFilesCreator = (platformModule) => (pluginContext) => __awaiter(void 0, void 0, void 0, function* () {
23
23
  const { pluginRunner, config } = pluginContext;
24
24
  const getCandidates = (fileName, fallbackType) => project_1.fileUtils.getUserCustomFileCandidates(pluginContext.paths.rootDir, fileName, fallbackType);
25
25
  const { public: publicRuntimeConfig, server: serverRuntimeConfig } = yield pluginRunner.modifyRuntimeConfig({
@@ -51,10 +51,8 @@ const getPresetRuntimeFilesCreator = (platformModule, polyfills) => (pluginConte
51
51
  context.platformModule = platformModule;
52
52
  context.runtimeConfig = Object.assign(Object.assign({}, serverRuntimeConfig), publicRuntimeConfig);
53
53
  const runner = pluginContext.pluginRunner;
54
- const appPolyfills = (yield runner.addPolyfill()).flat();
55
54
  const appEntryCodes = (yield runner.addEntryCode()).flat();
56
55
  context.entryCodes.push(...appEntryCodes);
57
- context.polyfills.push(...polyfills, ...appPolyfills);
58
56
  const files = (0, file_presets_1.getFilePresets)(context);
59
57
  return files;
60
58
  });
@@ -6,7 +6,6 @@ export interface UserModule {
6
6
  }
7
7
  export interface ProjectContext {
8
8
  entryCodes: string[];
9
- polyfills: string[];
10
9
  runtimeConfig: IRuntimeConfig;
11
10
  platformModule: string;
12
11
  userModule: UserModule;
@@ -4,7 +4,6 @@ exports.createProjectContext = void 0;
4
4
  const createProjectContext = () => {
5
5
  return {
6
6
  entryCodes: [],
7
- polyfills: [],
8
7
  runtimeConfig: {},
9
8
  platformModule: '',
10
9
  userModule: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuvi/platform-shared",
3
- "version": "1.0.0-rc.12",
3
+ "version": "1.0.0-rc.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/shuvijs/shuvi.git",
@@ -67,7 +67,8 @@
67
67
  "types": "./shuvi-type-extensions-node.d.js",
68
68
  "default": "./shuvi-type-extensions-node.js"
69
69
  },
70
- "./shuvi-type-extensions-runtime": "./shuvi-type-extensions-runtime.d.ts"
70
+ "./shuvi-type-extensions-runtime": "./shuvi-type-extensions-runtime.d.ts",
71
+ "./package.json": "./package.json"
71
72
  },
72
73
  "scripts": {
73
74
  "dev": "run-p watch:*",
@@ -82,18 +83,18 @@
82
83
  "node": ">= 12.0.0"
83
84
  },
84
85
  "dependencies": {
85
- "@shuvi/hook": "1.0.0-rc.12",
86
+ "@shuvi/hook": "1.0.0-rc.13",
86
87
  "@shuvi/redox": "0.0.6",
87
- "@shuvi/router": "1.0.0-rc.12",
88
- "@shuvi/runtime": "1.0.0-rc.12",
89
- "@shuvi/service": "1.0.0-rc.12",
90
- "@shuvi/shared": "1.0.0-rc.12",
91
- "@shuvi/toolpack": "1.0.0-rc.12",
92
- "@shuvi/utils": "1.0.0-rc.12",
88
+ "@shuvi/router": "1.0.0-rc.13",
89
+ "@shuvi/runtime": "1.0.0-rc.13",
90
+ "@shuvi/service": "1.0.0-rc.13",
91
+ "@shuvi/shared": "1.0.0-rc.13",
92
+ "@shuvi/toolpack": "1.0.0-rc.13",
93
+ "@shuvi/utils": "1.0.0-rc.13",
93
94
  "redux": "4.1.2"
94
95
  },
95
96
  "peerDependencies": {
96
- "@shuvi/service": "1.0.0-rc.12"
97
+ "@shuvi/service": "1.0.0-rc.13"
97
98
  },
98
99
  "devDependencies": {
99
100
  "@types/minimatch": "3.0.5"
@@ -1,3 +0,0 @@
1
- import { ProjectContext } from '../../../../projectContext';
2
- declare const _default: (context: ProjectContext) => Omit<import("@shuvi/service/lib/project/index").FileOptionWithoutId<string, any>, "name">;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const __1 = require("../../..");
4
- exports.default = (context) => (0, __1.defineFile)({
5
- content: () => context.polyfills.map(file => `import "${file}"`).join('\n')
6
- });