@shuvi/service 1.0.17 → 1.0.19

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 {
@@ -352,7 +352,6 @@ class WebpackBundler {
352
352
  ];
353
353
  }
354
354
  _getTargets() {
355
- var _a;
356
355
  return __awaiter(this, void 0, void 0, function* () {
357
356
  const targets = [];
358
357
  // get base config
@@ -380,7 +379,7 @@ class WebpackBundler {
380
379
  if (hasEntry(chain)) {
381
380
  const chainConfig = chain.toConfig();
382
381
  logger_1.default.debug(`${name} Config`);
383
- logger_1.default.debug((0, util_1.inspect)((_a = chainConfig.resolve) === null || _a === void 0 ? void 0 : _a.alias, { depth: 10 }));
382
+ logger_1.default.debug((0, util_1.inspect)(chainConfig, { depth: 16 }));
384
383
  targets.push({ name, config: chainConfig });
385
384
  }
386
385
  }
@@ -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[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuvi/service",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
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.17",
33
- "@shuvi/router": "1.0.17",
34
- "@shuvi/runtime": "1.0.17",
35
- "@shuvi/shared": "1.0.17",
36
- "@shuvi/toolpack": "1.0.17",
37
- "@shuvi/utils": "1.0.17",
38
- "@shuvi/error-overlay": "1.0.17",
39
- "@shuvi/telemetry": "1.0.17",
40
- "@shuvi/trace": "1.0.17",
32
+ "@shuvi/hook": "1.0.19",
33
+ "@shuvi/router": "1.0.19",
34
+ "@shuvi/runtime": "1.0.19",
35
+ "@shuvi/shared": "1.0.19",
36
+ "@shuvi/toolpack": "1.0.19",
37
+ "@shuvi/utils": "1.0.19",
38
+ "@shuvi/error-overlay": "1.0.19",
39
+ "@shuvi/telemetry": "1.0.19",
40
+ "@shuvi/trace": "1.0.19",
41
41
  "commander": "5.1.0",
42
42
  "comment-json": "4.2.2",
43
43
  "cross-spawn": "7.0.3",