@tarojs/service 3.7.0-alpha.6 → 3.7.0-alpha.8

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/dist/index.js CHANGED
@@ -14,14 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.TaroPlatformWeb = exports.TaroPlatformBase = exports.Kernel = exports.Config = void 0;
17
+ exports.TaroPlatformWeb = exports.TaroPlatformBase = exports.TaroPlatform = exports.Kernel = exports.Config = void 0;
18
18
  const Config_1 = require("./Config");
19
19
  exports.Config = Config_1.default;
20
20
  const Kernel_1 = require("./Kernel");
21
21
  exports.Kernel = Kernel_1.default;
22
22
  const platform_plugin_base_1 = require("./platform-plugin-base");
23
+ Object.defineProperty(exports, "TaroPlatform", { enumerable: true, get: function () { return platform_plugin_base_1.TaroPlatform; } });
23
24
  Object.defineProperty(exports, "TaroPlatformBase", { enumerable: true, get: function () { return platform_plugin_base_1.TaroPlatformBase; } });
24
25
  Object.defineProperty(exports, "TaroPlatformWeb", { enumerable: true, get: function () { return platform_plugin_base_1.TaroPlatformWeb; } });
25
26
  __exportStar(require("./utils/types"), exports);
26
- exports.default = { Config: Config_1.default, Kernel: Kernel_1.default, TaroPlatformBase: platform_plugin_base_1.TaroPlatformBase, TaroPlatformWeb: platform_plugin_base_1.TaroPlatformWeb };
27
+ exports.default = { Config: Config_1.default, Kernel: Kernel_1.default, TaroPlatform: platform_plugin_base_1.TaroPlatform, TaroPlatformBase: platform_plugin_base_1.TaroPlatformBase, TaroPlatformWeb: platform_plugin_base_1.TaroPlatformWeb };
27
28
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA6B;AAKpB,iBALF,gBAAM,CAKE;AAJf,qCAA6B;AAIZ,iBAJV,gBAAM,CAIU;AAHvB,iEAA0E;AAGjD,iGAHhB,uCAAgB,OAGgB;AAAE,gGAHhB,sCAAe,OAGgB;AAD1D,gDAA6B;AAE7B,kBAAe,EAAE,MAAM,EAAN,gBAAM,EAAE,MAAM,EAAN,gBAAM,EAAE,gBAAgB,EAAhB,uCAAgB,EAAE,eAAe,EAAf,sCAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA6B;AAKpB,iBALF,gBAAM,CAKE;AAJf,qCAA6B;AAIZ,iBAJV,gBAAM,CAIU;AAHvB,iEAAwF;AAG/D,6FAHhB,mCAAY,OAGgB;AAAE,iGAHhB,uCAAgB,OAGgB;AAAE,gGAHhB,sCAAe,OAGgB;AADxE,gDAA6B;AAE7B,kBAAe,EAAE,MAAM,EAAN,gBAAM,EAAE,MAAM,EAAN,gBAAM,EAAE,YAAY,EAAZ,mCAAY,EAAE,gBAAgB,EAAhB,uCAAgB,EAAE,eAAe,EAAf,sCAAe,EAAE,CAAA"}
@@ -14,6 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.TaroPlatform = void 0;
17
18
  __exportStar(require("./mini"), exports);
19
+ var platform_1 = require("./platform");
20
+ Object.defineProperty(exports, "TaroPlatform", { enumerable: true, get: function () { return platform_1.default; } });
18
21
  __exportStar(require("./web"), exports);
19
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform-plugin-base/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,wCAAqB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform-plugin-base/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,uCAAoD;AAA3C,wGAAA,OAAO,OAAgB;AAChC,wCAAqB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/service",
3
- "version": "3.7.0-alpha.6",
3
+ "version": "3.7.0-alpha.8",
4
4
  "description": "Taro Service",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -30,9 +30,9 @@
30
30
  "tapable": "^1.1.3",
31
31
  "webpack-merge": "^4.2.2",
32
32
  "ora": "^5.0.0",
33
- "@tarojs/helper": "3.7.0-alpha.6",
34
- "@tarojs/shared": "3.7.0-alpha.6",
35
- "@tarojs/taro": "3.7.0-alpha.6"
33
+ "@tarojs/helper": "3.7.0-alpha.8",
34
+ "@tarojs/shared": "3.7.0-alpha.8",
35
+ "@tarojs/taro": "3.7.0-alpha.8"
36
36
  },
37
37
  "devDependencies": {
38
38
  "vite": "^4.2.0",
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import Config from './Config'
2
2
  import Kernel from './Kernel'
3
- import { TaroPlatformBase, TaroPlatformWeb } from './platform-plugin-base'
3
+ import { TaroPlatform, TaroPlatformBase, TaroPlatformWeb } from './platform-plugin-base'
4
4
 
5
5
  export * from './utils/types'
6
- export { Config, Kernel, TaroPlatformBase, TaroPlatformWeb }
7
- export default { Config, Kernel, TaroPlatformBase, TaroPlatformWeb }
6
+ export { Config, Kernel, TaroPlatform, TaroPlatformBase, TaroPlatformWeb }
7
+ export default { Config, Kernel, TaroPlatform, TaroPlatformBase, TaroPlatformWeb }
8
8
 
9
9
  export type { IPluginContext } from './utils/types'
@@ -1,2 +1,3 @@
1
1
  export * from './mini'
2
+ export { default as TaroPlatform } from './platform'
2
3
  export * from './web'
@@ -1,6 +1,6 @@
1
1
  import type helper from '@tarojs/helper'
2
- import type { IProjectConfig } from '@tarojs/taro/types/compile'
3
- import type { IModifyWebpackChain } from '@tarojs/taro/types/compile/hooks'
2
+ import type { IMiniFilesConfig, IProjectConfig } from '@tarojs/taro/types/compile'
3
+ import type { IModifyChainData } from '@tarojs/taro/types/compile/hooks'
4
4
  import type joi from 'joi'
5
5
  import type Webpack from 'webpack'
6
6
  import type Chain from 'webpack-chain'
@@ -138,11 +138,11 @@ export declare interface IPluginContext {
138
138
  /**
139
139
  * 编译中修改 webpack 配置,在这个钩子中,你可以对 webpackChain 作出想要的调整,等同于配置 [`webpackChain`](./config-detail.md#miniwebpackchain)
140
140
  */
141
- modifyWebpackChain: (fn: (args: { chain: Chain, webpack: typeof Webpack, data?: IModifyWebpackChain }) => void) => void
141
+ modifyWebpackChain: (fn: (args: { chain: Chain, webpack: typeof Webpack, data?: IModifyChainData }) => void) => void
142
142
  /**
143
143
  * 编译中修改 vite 配置
144
144
  */
145
- modifyViteConfig: (fn: (args: { viteConfig: any, componentConfig?: IModifyWebpackChain['componentConfig'] }) => void) => void
145
+ modifyViteConfig: (fn: (args: { viteConfig: any, data?: IModifyChainData }) => void) => void
146
146
  /**
147
147
  * 修改编译后的结果
148
148
  */
@@ -150,7 +150,11 @@ export declare interface IPluginContext {
150
150
  /**
151
151
  * 修改编译过程中的页面组件配置
152
152
  */
153
- modifyMiniConfigs: (fn: (args: { configMap: any }) => void) => void
153
+ modifyMiniConfigs: (fn: (args: { configMap: IMiniFilesConfig }) => void) => void
154
+ /**
155
+ * 修改 Taro 编译配置
156
+ */
157
+ modifyRunnerOpts: (fn: (args: { opts: any }) => void) => void
154
158
 
155
159
  [key: string]: any
156
160
  }
package/types/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import Config from './Config';
2
2
  import Kernel from './Kernel';
3
- import { TaroPlatformBase, TaroPlatformWeb } from './platform-plugin-base';
3
+ import { TaroPlatform, TaroPlatformBase, TaroPlatformWeb } from './platform-plugin-base';
4
4
  export * from './utils/types';
5
- export { Config, Kernel, TaroPlatformBase, TaroPlatformWeb };
5
+ export { Config, Kernel, TaroPlatform, TaroPlatformBase, TaroPlatformWeb };
6
6
  declare const _default: {
7
7
  Config: typeof Config;
8
8
  Kernel: typeof Kernel;
9
+ TaroPlatform: typeof TaroPlatform;
9
10
  TaroPlatformBase: typeof TaroPlatformBase;
10
11
  TaroPlatformWeb: typeof TaroPlatformWeb;
11
12
  };
@@ -1,2 +1,3 @@
1
1
  export * from './mini';
2
+ export { default as TaroPlatform } from './platform';
2
3
  export * from './web';
@@ -1,6 +1,6 @@
1
1
  import type helper from '@tarojs/helper';
2
- import type { IProjectConfig } from '@tarojs/taro/types/compile';
3
- import type { IModifyWebpackChain } from '@tarojs/taro/types/compile/hooks';
2
+ import type { IMiniFilesConfig, IProjectConfig } from '@tarojs/taro/types/compile';
3
+ import type { IModifyChainData } from '@tarojs/taro/types/compile/hooks';
4
4
  import type joi from 'joi';
5
5
  import type Webpack from 'webpack';
6
6
  import type Chain from 'webpack-chain';
@@ -142,14 +142,14 @@ export declare interface IPluginContext {
142
142
  modifyWebpackChain: (fn: (args: {
143
143
  chain: Chain;
144
144
  webpack: typeof Webpack;
145
- data?: IModifyWebpackChain;
145
+ data?: IModifyChainData;
146
146
  }) => void) => void;
147
147
  /**
148
148
  * 编译中修改 vite 配置
149
149
  */
150
150
  modifyViteConfig: (fn: (args: {
151
151
  viteConfig: any;
152
- componentConfig?: IModifyWebpackChain['componentConfig'];
152
+ data?: IModifyChainData;
153
153
  }) => void) => void;
154
154
  /**
155
155
  * 修改编译后的结果
@@ -162,7 +162,13 @@ export declare interface IPluginContext {
162
162
  * 修改编译过程中的页面组件配置
163
163
  */
164
164
  modifyMiniConfigs: (fn: (args: {
165
- configMap: any;
165
+ configMap: IMiniFilesConfig;
166
+ }) => void) => void;
167
+ /**
168
+ * 修改 Taro 编译配置
169
+ */
170
+ modifyRunnerOpts: (fn: (args: {
171
+ opts: any;
166
172
  }) => void) => void;
167
173
  [key: string]: any;
168
174
  }