@tuya-sat/micro-script 3.2.6 → 3.2.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.
@@ -56,7 +56,7 @@ const toArray = (value) => {
56
56
  return Array.isArray(value) ? value : [value];
57
57
  };
58
58
  const validateMicroTheme = () => {
59
- const microTheme = process.env.MICRO_THEME;
59
+ const microTheme = (process.env.MICRO_THEME || index_1.LIGHT_THEME);
60
60
  if (microTheme && ![index_1.DARK_THEME, index_1.LIGHT_THEME].includes(microTheme)) {
61
61
  console.error(`请设置正确的MICRO_THEME环境变量,当前值为${microTheme},请修改为${index_1.LIGHT_THEME}或${index_1.DARK_THEME}`);
62
62
  return process.exit(1);
@@ -70,7 +70,7 @@ function getCommonConfig({ isDev, isBuild, }) {
70
70
  const enableThemeCompile = isDev
71
71
  ? !!devMicroTheme
72
72
  : (0, utils_2.getAnnotations)()['sdf.feat:colorTheme'];
73
- const isReactTsMicroApp = (0, utils_2.getAnnotations)()['sdf.feat:colorTheme'] === 'REACT_TS';
73
+ const isReactTsMicroApp = (0, utils_2.getAnnotations)()['sdf.cli:microFramework'] === 'REACT_TS';
74
74
  //获取style处理的loader
75
75
  const getStyleLoaders = (extraLoader = []) => {
76
76
  extraLoader = toArray(extraLoader);
@@ -114,11 +114,10 @@ function insertScript($, debuggerConfig) {
114
114
  return item.config_key === 'dynamic_theme';
115
115
  }) || initalCustom_configs(saas);
116
116
  const theme = (0, webpack_common_1.validateMicroTheme)();
117
- themeConfig.config_value_json = JSON.stringify(Object.assign(Object.assign(Object.assign({}, JSON.parse(themeConfig.config_value_json)), (theme
118
- ? {
119
- supportedTheme: theme,
120
- }
121
- : {})), readThemeConfig()));
117
+ const configJson = JSON.parse(themeConfig.config_value_json);
118
+ themeConfig.config_value_json = JSON.stringify(Object.assign(Object.assign(Object.assign({}, configJson), { supportedTheme: configJson.supportedTheme === 'all'
119
+ ? configJson.supportedTheme
120
+ : theme }), readThemeConfig()));
122
121
  overrideNotification(saas);
123
122
  if (fs.existsSync(path.join(process.cwd(), 'saas-info.config.json'))) {
124
123
  const saasInfo = fs.readJSONSync(path.join(process.cwd(), 'saas-info.config.json'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-script",
3
- "version": "3.2.6",
3
+ "version": "3.2.8",
4
4
  "bin": "./dist/bin/cli.js",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
@@ -23,9 +23,9 @@
23
23
  "@babel/preset-typescript": "7.16.7",
24
24
  "@babel/traverse": "^7.20.13",
25
25
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
26
- "@tuya-sat/micro-dev-loader": "3.2.6",
27
- "@tuya-sat/micro-dev-proxy": "3.2.6",
28
- "@tuya-sat/micro-utils": "3.2.6",
26
+ "@tuya-sat/micro-dev-loader": "3.2.8",
27
+ "@tuya-sat/micro-dev-proxy": "3.2.8",
28
+ "@tuya-sat/micro-utils": "3.2.8",
29
29
  "@types/kill-port": "^2.0.0",
30
30
  "babel-loader": "8.2.4",
31
31
  "babel-plugin-import": "1.13.3",