@shuvi/service 1.0.16 → 1.0.18

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.
@@ -20,7 +20,7 @@ declare type EventPackageDetected = {
20
20
  };
21
21
  export declare function eventPackageDetected(dir: string): Promise<Array<EventPackageDetected>>;
22
22
  export declare const EVENT_BUILD_FEATURE_USAGE = "SHUVI_BUILD_FEATURE_USAGE";
23
- export declare type Feature = 'shuvi/lightningCss' | 'shuvi/webpack-dll' | 'swcPlugins' | 'swcModularizeImports' | 'swcRemoveConsole' | 'swcReactRemoveProperties' | 'swcJsxImportSource' | 'swcStyledComponents' | 'swcEmotion' | 'swcExperimentalDecorators' | 'swcEmitDecoratorMetadata';
23
+ export declare type Feature = 'shuvi/lightningCss' | 'shuvi/webpack-dll' | 'swcPlugins' | 'swcModularizeImports' | 'swcRemoveConsole' | 'swcReactRemoveProperties' | 'swcJsxImportSource' | 'swcStyledComponents' | 'swcEmotion';
24
24
  export declare type EventBuildFeatureUsage = {
25
25
  featureName: Feature;
26
26
  invocationCount: number;
@@ -66,9 +66,7 @@ const BUILD_FEATURES = [
66
66
  'swcReactRemoveProperties',
67
67
  'swcJsxImportSource',
68
68
  'swcStyledComponents',
69
- 'swcEmotion',
70
- 'swcExperimentalDecorators',
71
- 'swcEmitDecoratorMetadata'
69
+ 'swcEmotion'
72
70
  ];
73
71
  function eventBuildFeatureUsage({ compiler, experimental }) {
74
72
  var _a;
@@ -81,9 +79,7 @@ function eventBuildFeatureUsage({ compiler, experimental }) {
81
79
  ['swcReactRemoveProperties', !!(compiler === null || compiler === void 0 ? void 0 : compiler.reactRemoveProperties)],
82
80
  ['swcJsxImportSource', !!(compiler === null || compiler === void 0 ? void 0 : compiler.jsxImportSource)],
83
81
  ['swcStyledComponents', !!(compiler === null || compiler === void 0 ? void 0 : compiler.styledComponents)],
84
- ['swcEmotion', !!(compiler === null || compiler === void 0 ? void 0 : compiler.emotion)],
85
- ['swcExperimentalDecorators', !!(compiler === null || compiler === void 0 ? void 0 : compiler.experimentalDecorators)],
86
- ['swcEmitDecoratorMetadata', !!(compiler === null || compiler === void 0 ? void 0 : compiler.emitDecoratorMetadata)]
82
+ ['swcEmotion', !!(compiler === null || compiler === void 0 ? void 0 : compiler.emotion)]
87
83
  ].filter(Boolean));
88
84
  return BUILD_FEATURES.map(featureName => {
89
85
  return {
@@ -16,6 +16,7 @@ const config_1 = require("@shuvi/toolpack/lib/webpack/config");
16
16
  const typescript_1 = require("./typescript");
17
17
  const AppSourceRegexp = /([/\\]shuvi-app[/\\])|([/\\]\.shuvi[/\\])/;
18
18
  function createWebpackConfig({ mode, assetPublicPath, paths, config }, _a) {
19
+ var _b, _c;
19
20
  var opts = __rest(_a, []);
20
21
  const dev = mode === 'development';
21
22
  let chain;
@@ -35,8 +36,8 @@ function createWebpackConfig({ mode, assetPublicPath, paths, config }, _a) {
35
36
  ];
36
37
  const lightningCss = !!config.experimental.lightningCss;
37
38
  const experimental = config.experimental;
38
- const compiler = Object.assign(Object.assign({}, config.compiler), { modularizeImports: experimental.modularizeImports, swcPlugins: experimental.swcPlugins });
39
39
  const jsConfig = (0, typescript_1.getJavaScriptInfo)();
40
+ const compiler = Object.assign(Object.assign({}, config.compiler), { modularizeImports: experimental.modularizeImports, swcPlugins: experimental.swcPlugins, experimentalDecorators: Boolean((_b = jsConfig === null || jsConfig === void 0 ? void 0 : jsConfig.compilerOptions) === null || _b === void 0 ? void 0 : _b.experimentalDecorators), emitDecoratorMetadata: Boolean((_c = jsConfig === null || jsConfig === void 0 ? void 0 : jsConfig.compilerOptions) === null || _c === void 0 ? void 0 : _c.emitDecoratorMetadata) });
40
41
  if (opts.node) {
41
42
  chain = (0, config_1.createNodeWebpackChain)({
42
43
  name,
@@ -76,8 +76,6 @@ export interface CompilerConfig {
76
76
  jsxImportSource?: CompilerOptions['jsxImportSource'];
77
77
  styledComponents?: CompilerOptions['styledComponents'];
78
78
  emotion?: CompilerOptions['emotion'];
79
- experimentalDecorators?: CompilerOptions['experimentalDecorators'];
80
- emitDecoratorMetadata?: CompilerOptions['emitDecoratorMetadata'];
81
79
  }
82
80
  export interface InternalConfig {
83
81
  presets?: IPresetConfig[];
@@ -63,8 +63,8 @@ class WebpackHotMiddleware {
63
63
  case 'client-hmr-latency': {
64
64
  traceChild = {
65
65
  name: parsedData.event,
66
- startTime: BigInt(parsedData.startTime * 1000 * 1000),
67
- endTime: BigInt(parsedData.endTime * 1000 * 1000)
66
+ startTime: BigInt(parsedData.startTime) * BigInt(1000 * 1000),
67
+ endTime: BigInt(parsedData.endTime) * BigInt(1000 * 1000)
68
68
  };
69
69
  break;
70
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuvi/service",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/shuvijs/shuvi.git",
@@ -29,15 +29,15 @@
29
29
  "@babel/generator": "7.14.5",
30
30
  "@babel/parser": "7.14.7",
31
31
  "@babel/traverse": "7.14.7",
32
- "@shuvi/hook": "1.0.16",
33
- "@shuvi/router": "1.0.16",
34
- "@shuvi/runtime": "1.0.16",
35
- "@shuvi/shared": "1.0.16",
36
- "@shuvi/toolpack": "1.0.16",
37
- "@shuvi/utils": "1.0.16",
38
- "@shuvi/error-overlay": "1.0.16",
39
- "@shuvi/telemetry": "1.0.16",
40
- "@shuvi/trace": "1.0.16",
32
+ "@shuvi/hook": "1.0.18",
33
+ "@shuvi/router": "1.0.18",
34
+ "@shuvi/runtime": "1.0.18",
35
+ "@shuvi/shared": "1.0.18",
36
+ "@shuvi/toolpack": "1.0.18",
37
+ "@shuvi/utils": "1.0.18",
38
+ "@shuvi/error-overlay": "1.0.18",
39
+ "@shuvi/telemetry": "1.0.18",
40
+ "@shuvi/trace": "1.0.18",
41
41
  "commander": "5.1.0",
42
42
  "comment-json": "4.2.2",
43
43
  "cross-spawn": "7.0.3",