@modern-js/tailwindcss-generator 2.2.1 → 2.3.3

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.
Files changed (2) hide show
  1. package/dist/index.js +71 -110
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -35669,20 +35669,28 @@ var require_compiled = __commonJSMin((exports) => {
35669
35669
  var require_format = __commonJSMin((exports) => {
35670
35670
  "use strict";
35671
35671
  Object.defineProperty(exports, "__esModule", { value: true });
35672
- exports.formatProxyOptions = exports.formatWebpackMessages = void 0;
35673
- var friendlySyntaxErrorLabel = "Syntax error:";
35672
+ exports.formatWebpackMessages = void 0;
35673
+ var friendlySyntaxErrorLabel = "SyntaxError:";
35674
35674
  function isLikelyASyntaxError(message) {
35675
35675
  return message.includes(friendlySyntaxErrorLabel);
35676
35676
  }
35677
- function formatMessage(message) {
35678
- var _a;
35677
+ function formatMessage(stats) {
35679
35678
  let lines = [];
35680
- if (typeof message === "object") {
35681
- message = `${message.moduleName && `${message.moduleName}
35682
- `}${message.details || message.stack || message.message}`;
35679
+ let message;
35680
+ if (typeof stats === "object") {
35681
+ const fileName = stats.moduleName ? `File: ${stats.moduleName}
35682
+ ` : "";
35683
+ const mainMessage = stats.message;
35684
+ const details = stats.details ? `
35685
+ Details: ${stats.details}
35686
+ ` : "";
35687
+ const stack = stats.stack ? `
35688
+ ${stats.stack}` : "";
35689
+ message = `${fileName}${mainMessage}${details}${stack}`;
35690
+ } else {
35691
+ message = stats;
35683
35692
  }
35684
35693
  lines = message.split("\n");
35685
- lines = lines.filter((line3) => !/Module [A-z ]+\(from/.test(line3));
35686
35694
  lines = lines.map((line3) => {
35687
35695
  const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(line3);
35688
35696
  if (!parsingError) {
@@ -35699,11 +35707,8 @@ var require_format = __commonJSMin((exports) => {
35699
35707
  lines.splice(1, 1);
35700
35708
  }
35701
35709
  lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, "$1");
35702
- if ((_a = lines[1]) === null || _a === void 0 ? void 0 : _a.startsWith("Module not found: ")) {
35703
- lines = [
35704
- lines[0],
35705
- lines[1].replace("Error: ", "").replace("Module not found: Cannot find file:", "Cannot find file:").replace("[CaseSensitivePathsPlugin] ", "").replace("Cannot resolve 'file' or 'directory' ", "")
35706
- ];
35710
+ if (lines[1] && lines[1].indexOf("Module not found:") !== -1) {
35711
+ lines[1] = lines[1].replace("Error: ", "");
35707
35712
  }
35708
35713
  message = lines.join("\n");
35709
35714
  message = message.replace(/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm, "");
@@ -35730,29 +35735,6 @@ var require_format = __commonJSMin((exports) => {
35730
35735
  return result;
35731
35736
  }
35732
35737
  exports.formatWebpackMessages = formatWebpackMessages;
35733
- function formatProxyOptions(proxyOptions) {
35734
- const formattedProxy = [];
35735
- if (!Array.isArray(proxyOptions)) {
35736
- if ("target" in proxyOptions) {
35737
- formattedProxy.push(proxyOptions);
35738
- } else {
35739
- Array.prototype.push.apply(formattedProxy, Object.keys(proxyOptions).reduce((total, source) => {
35740
- const option = proxyOptions[source];
35741
- total.push({
35742
- context: source,
35743
- changeOrigin: true,
35744
- logLevel: "warn",
35745
- ...typeof option === "string" ? { target: option } : option
35746
- });
35747
- return total;
35748
- }, []));
35749
- }
35750
- } else {
35751
- formattedProxy.push(...proxyOptions);
35752
- }
35753
- return formattedProxy;
35754
- }
35755
- exports.formatProxyOptions = formatProxyOptions;
35756
35738
  });
35757
35739
  var require_logger = __commonJSMin((exports) => {
35758
35740
  "use strict";
@@ -36252,7 +36234,6 @@ var require_constants = __commonJSMin((exports) => {
36252
36234
  "@modern-js/plugin-electron": { cli: "@modern-js/plugin-electron/cli" },
36253
36235
  "@modern-js/plugin-testing": { cli: "@modern-js/plugin-testing/cli" },
36254
36236
  "@modern-js/plugin-storybook": { cli: "@modern-js/plugin-storybook/cli" },
36255
- "@modern-js/plugin-docsite": { cli: "@modern-js/plugin-docsite/cli" },
36256
36237
  "@modern-js/plugin-express": {
36257
36238
  cli: "@modern-js/plugin-express/cli",
36258
36239
  server: "@modern-js/plugin-express"
@@ -36270,7 +36251,6 @@ var require_constants = __commonJSMin((exports) => {
36270
36251
  server: "@modern-js/plugin-nest/server"
36271
36252
  },
36272
36253
  "@modern-js/plugin-unbundle": { cli: "@modern-js/plugin-unbundle" },
36273
- "@modern-js/plugin-server-build": { cli: "@modern-js/plugin-server-build" },
36274
36254
  "@modern-js/plugin-server": {
36275
36255
  cli: "@modern-js/plugin-server/cli",
36276
36256
  server: "@modern-js/plugin-server/server"
@@ -36278,26 +36258,12 @@ var require_constants = __commonJSMin((exports) => {
36278
36258
  "@modern-js/plugin-garfish": {
36279
36259
  cli: "@modern-js/plugin-garfish/cli"
36280
36260
  },
36281
- "@modern-js/plugin-jarvis": { cli: "@modern-js/plugin-jarvis/cli" },
36282
36261
  "@modern-js/plugin-tailwindcss": { cli: "@modern-js/plugin-tailwindcss/cli" },
36283
- "@modern-js/plugin-lambda-fc": { cli: "@modern-js/plugin-lambda-fc/cli" },
36284
- "@modern-js/plugin-lambda-scf": { cli: "@modern-js/plugin-lambda-scf/cli" },
36285
- "@modern-js/plugin-cdn-oss": { cli: "@modern-js/plugin-cdn-oss/cli" },
36286
- "@modern-js/plugin-cdn-cos": { cli: "@modern-js/plugin-cdn-cos/cli" },
36287
- "@modern-js/plugin-static-hosting": {
36288
- cli: "@modern-js/plugin-static-hosting/cli"
36289
- },
36290
36262
  "@modern-js/plugin-polyfill": {
36291
36263
  cli: "@modern-js/plugin-polyfill/cli",
36292
36264
  server: "@modern-js/plugin-polyfill"
36293
36265
  },
36294
- "@modern-js/plugin-multiprocess": {
36295
- cli: "@modern-js/plugin-multiprocess/cli"
36296
- },
36297
- "@modern-js/plugin-nocode": { cli: "@modern-js/plugin-nocode/cli" },
36298
- "@modern-js/plugin-design-token": {
36299
- cli: "@modern-js/plugin-design-token/cli"
36300
- }
36266
+ "@modern-js/plugin-nocode": { cli: "@modern-js/plugin-nocode/cli" }
36301
36267
  };
36302
36268
  exports.PLUGIN_SCHEMAS = {
36303
36269
  "@modern-js/runtime": [
@@ -37285,8 +37251,8 @@ var require_analyzeProject = __commonJSMin((exports) => {
37285
37251
  exports.isApiOnly = void 0;
37286
37252
  var path2 = __importStar(__require("path"));
37287
37253
  var compiled_1 = require_compiled();
37288
- var isApiOnly = async (appDirectory) => {
37289
- const srcDir = path2.join(appDirectory, "src");
37254
+ var isApiOnly = async (appDirectory, entryDir) => {
37255
+ const srcDir = path2.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src");
37290
37256
  const existSrc = await compiled_1.fs.pathExists(srcDir);
37291
37257
  const options2 = (0, compiled_1.minimist)(process.argv.slice(2));
37292
37258
  return !existSrc || Boolean(options2["api-only"]);
@@ -37300,7 +37266,18 @@ var require_chainId = __commonJSMin((exports) => {
37300
37266
  exports.CHAIN_ID = {
37301
37267
  RULE: {
37302
37268
  MJS: "mjs",
37303
- LOADERS: "loaders"
37269
+ LOADERS: "loaders",
37270
+ FONT: "font",
37271
+ IMAGE: "image",
37272
+ MEDIA: "media",
37273
+ JS: "js",
37274
+ TS: "ts",
37275
+ CSS: "css",
37276
+ LESS: "less",
37277
+ SASS: "sass",
37278
+ SVG: "svg",
37279
+ SVG_INLINE: "svg-inline",
37280
+ SVG_URL: "svg-url"
37304
37281
  },
37305
37282
  ONE_OF: {
37306
37283
  JS: "js",
@@ -37326,6 +37303,8 @@ var require_chainId = __commonJSMin((exports) => {
37326
37303
  USE: {
37327
37304
  TS: "ts",
37328
37305
  CSS: "css",
37306
+ SASS: "sass",
37307
+ LESS: "less",
37329
37308
  URL: "url",
37330
37309
  FILE: "file",
37331
37310
  SVGR: "svgr",
@@ -37354,6 +37333,7 @@ var require_chainId = __commonJSMin((exports) => {
37354
37333
  INLINE_HTML: "inline-html",
37355
37334
  BUNDLE_ANALYZER: "bundle-analyze",
37356
37335
  BOTTOM_TEMPLATE: "bottom-template",
37336
+ HTML_CROSS_ORIGIN: "html-cross-origin",
37357
37337
  MINI_CSS_EXTRACT: "mini-css-extract",
37358
37338
  REACT_FAST_REFRESH: "react-fast-refresh",
37359
37339
  NODE_POLYFILL_PROVIDE: "node-polyfill-provide"
@@ -37369,6 +37349,32 @@ var require_chainId = __commonJSMin((exports) => {
37369
37349
  }
37370
37350
  };
37371
37351
  });
37352
+ var require_reactVersion = __commonJSMin((exports) => {
37353
+ "use strict";
37354
+ var __importDefault = exports && exports.__importDefault || function(mod) {
37355
+ return mod && mod.__esModule ? mod : { "default": mod };
37356
+ };
37357
+ Object.defineProperty(exports, "__esModule", { value: true });
37358
+ exports.isReact18 = void 0;
37359
+ var path_1 = __importDefault(__require("path"));
37360
+ var compiled_1 = require_compiled();
37361
+ var isReact18 = (cwd) => {
37362
+ const pkgPath = path_1.default.join(cwd, "package.json");
37363
+ if (!compiled_1.fs.existsSync(pkgPath)) {
37364
+ return false;
37365
+ }
37366
+ const pkgInfo = JSON.parse(compiled_1.fs.readFileSync(pkgPath, "utf8"));
37367
+ const deps = {
37368
+ ...pkgInfo.devDependencies,
37369
+ ...pkgInfo.dependencies
37370
+ };
37371
+ if (typeof deps.react !== "string") {
37372
+ return false;
37373
+ }
37374
+ return compiled_1.semver.satisfies(compiled_1.semver.minVersion(deps.react), ">=18.0.0");
37375
+ };
37376
+ exports.isReact18 = isReact18;
37377
+ });
37372
37378
  var require_dist = __commonJSMin((exports) => {
37373
37379
  "use strict";
37374
37380
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
@@ -37428,6 +37434,7 @@ var require_dist = __commonJSMin((exports) => {
37428
37434
  __exportStar(require_tryResolve(), exports);
37429
37435
  __exportStar(require_analyzeProject(), exports);
37430
37436
  __exportStar(require_chainId(), exports);
37437
+ __exportStar(require_reactVersion(), exports);
37431
37438
  });
37432
37439
  var require_esprima = __commonJSMin((exports, module2) => {
37433
37440
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -45797,6 +45804,7 @@ var require_generator = __commonJSMin((exports) => {
45797
45804
  this.materialsManager = materialsManager;
45798
45805
  this.outputPath = outputPath;
45799
45806
  this.event = new _events.EventEmitter();
45807
+ this.event.setMaxListeners(15);
45800
45808
  this._context = _objectSpread({
45801
45809
  materials: {},
45802
45810
  config: {},
@@ -99712,7 +99720,6 @@ var ZH_LOCALE = {
99712
99720
  mwa_storybook: "\u542F\u7528\u300CVisual Testing (Storybook)\u300D\u6A21\u5F0F",
99713
99721
  ssg: "\u542F\u7528\u300CSSG\u300D\u529F\u80FD",
99714
99722
  polyfill: "\u542F\u7528\u300C\u57FA\u4E8E UA \u7684 Polyfill\u300D\u529F\u80FD",
99715
- deploy: "\u542F\u7528\u300C\u90E8\u7F72\u300D\u529F\u80FD",
99716
99723
  proxy: "\u542F\u7528\u300C\u5168\u5C40\u4EE3\u7406\u300D"
99717
99724
  },
99718
99725
  element: {
@@ -99740,22 +99747,15 @@ var ZH_LOCALE = {
99740
99747
  no: "\u4E0D\u9700\u8981",
99741
99748
  electron: "Electron"
99742
99749
  },
99743
- needModifyConfig: {
99744
- self: "\u662F\u5426\u9700\u8981\u8C03\u6574\u9ED8\u8BA4\u914D\u7F6E?",
99745
- enableLess: "\u662F\u5426\u542F\u7528 Less \u652F\u6301?",
99746
- enableSass: "\u662F\u5426\u542F\u7528 Sass \u652F\u6301?"
99747
- },
99748
99750
  entry: {
99749
99751
  name: "\u8BF7\u586B\u5199\u5165\u53E3\u540D\u79F0",
99750
99752
  no_empty: "\u5165\u53E3\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\uFF01",
99751
99753
  no_pages: '\u5165\u53E3\u540D\u79F0\u4E0D\u652F\u6301 "pages"\uFF01',
99752
99754
  needModifyConfig: "\u662F\u5426\u9700\u8981\u8C03\u6574\u9ED8\u8BA4\u914D\u7F6E?",
99753
- disableStateManagement: "\u662F\u5426\u5173\u95ED\u300C\u5E94\u7528\u72B6\u6001\u7BA1\u7406\u300D\u529F\u80FD?",
99754
99755
  clientRoute: {
99755
99756
  self: "\u8BF7\u9009\u62E9\u5BA2\u6237\u7AEF\u8DEF\u7531\u65B9\u5F0F",
99756
- selfControlRoute: "\u542F\u7528\u81EA\u63A7\u8DEF\u7531",
99757
- conventionalRoute: "\u542F\u7528\u7EA6\u5B9A\u5F0F\u8DEF\u7531",
99758
- no: "\u4E0D\u542F\u7528"
99757
+ selfControlRoute: "\u81EA\u63A7\u8DEF\u7531",
99758
+ conventionalRoute: "\u7EA6\u5B9A\u5F0F\u8DEF\u7531"
99759
99759
  }
99760
99760
  },
99761
99761
  packageName: {
@@ -99781,23 +99781,6 @@ var ZH_LOCALE = {
99781
99781
  func: "\u51FD\u6570\u6A21\u5F0F",
99782
99782
  framework: "\u6846\u67B6\u6A21\u5F0F"
99783
99783
  }
99784
- },
99785
- deploy: {
99786
- cloud: {
99787
- self: "\u9ED8\u8BA4\u4F7F\u7528\u6846\u67B6\u5185\u7F6E\u7684\u4EA7\u54C1\u7EA7 Web \u670D\u52A1\u5668\uFF0C\u662F\u5426\u8C03\u6574\uFF1F"
99788
- },
99789
- cdn: {
99790
- self: "\u8BF7\u9009\u62E9 CDN \u5E73\u53F0",
99791
- oss: "\u963F\u91CC\u4E91 OSS",
99792
- cos: "\u817E\u8BAF\u4E91 COS",
99793
- no: "\u4E0D\u4F7F\u7528 CDN"
99794
- },
99795
- lambda: {
99796
- self: "\u8BF7\u9009\u62E9\u4E91\u51FD\u6570\u5E73\u53F0",
99797
- fc: "\u963F\u91CC\u4E91 FC",
99798
- scf: "\u817E\u8BAF\u4E91 SCF",
99799
- no: "\u4E0D\u4F7F\u7528\u4E91\u51FD\u6570\u90E8\u7F72"
99800
- }
99801
99784
  }
99802
99785
  };
99803
99786
  var EN_LOCALE = {
@@ -99839,7 +99822,6 @@ var EN_LOCALE = {
99839
99822
  mwa_storybook: "Enable Visual Testing (Storybook)",
99840
99823
  ssg: "Enable SSG",
99841
99824
  polyfill: "Enable UA-based Polyfill Feature",
99842
- deploy: "Enable Deploy",
99843
99825
  proxy: "Enable Global Proxy"
99844
99826
  },
99845
99827
  element: {
@@ -99877,21 +99859,15 @@ var EN_LOCALE = {
99877
99859
  no: "Not Enabled",
99878
99860
  electron: "Electron"
99879
99861
  },
99880
- needModifyConfig: {
99881
- self: "Modify the Default Configuration?",
99882
- enableLess: "Enable Less?",
99883
- enableSass: "Enable Sass?"
99884
- },
99885
99862
  entry: {
99886
99863
  name: "Entry name",
99887
99864
  no_empty: "The entry name cannot be empty!",
99888
99865
  no_pages: 'The entry name cannot be "pages"!',
99889
- disableStateManagement: "Disable App State Management?",
99866
+ needModifyConfig: "Modify the Default Configuration?",
99890
99867
  clientRoute: {
99891
99868
  self: "Client Routing",
99892
- selfControlRoute: "Enable Self Control Route",
99893
- conventionalRoute: "Enable Conventional Route",
99894
- no: "Not Enabled"
99869
+ selfControlRoute: "Self Control Route",
99870
+ conventionalRoute: "Conventional Route"
99895
99871
  }
99896
99872
  },
99897
99873
  framework: {
@@ -99907,23 +99883,6 @@ var EN_LOCALE = {
99907
99883
  func: "Function",
99908
99884
  framework: "Framework"
99909
99885
  }
99910
- },
99911
- deploy: {
99912
- cloud: {
99913
- self: "Modify the default Web Server?"
99914
- },
99915
- cdn: {
99916
- self: "Please select the cdn platform you want to use",
99917
- oss: "Aliyun OSS",
99918
- cos: "Tencent COS",
99919
- no: "Not Enabled"
99920
- },
99921
- lambda: {
99922
- self: "Please select the lambda you want to use",
99923
- fc: "Aliyun FC",
99924
- scf: "Tencent SCF",
99925
- no: "Not Enabled"
99926
- }
99927
99886
  }
99928
99887
  };
99929
99888
  var i18n = new I18n2();
@@ -99935,6 +99894,7 @@ init_toConsumableArray();
99935
99894
  init_defineProperty();
99936
99895
  var _SolutionText;
99937
99896
  var _SubSolutionText;
99897
+ var _SolutionToolsMap;
99938
99898
  var _SolutionGenerator;
99939
99899
  var _SubSolutionGenerator;
99940
99900
  var Solution;
@@ -99966,6 +99926,7 @@ var SubSolutionText = (_SubSolutionText = {}, _defineProperty(_SubSolutionText,
99966
99926
  }), _defineProperty(_SubSolutionText, SubSolution.InnerModule, function() {
99967
99927
  return i18n.t(localeKeys.sub_solution.inner_module);
99968
99928
  }), _SubSolutionText);
99929
+ var SolutionToolsMap = (_SolutionToolsMap = {}, _defineProperty(_SolutionToolsMap, Solution.MWA, "@modern-js/app-tools"), _defineProperty(_SolutionToolsMap, Solution.Module, "@modern-js/module-tools"), _defineProperty(_SolutionToolsMap, Solution.Monorepo, "@modern-js/monorepo-tools"), _SolutionToolsMap);
99969
99930
  var SolutionGenerator = (_SolutionGenerator = {}, _defineProperty(_SolutionGenerator, Solution.MWA, "@modern-js/mwa-generator"), _defineProperty(_SolutionGenerator, Solution.Module, "@modern-js/module-generator"), _defineProperty(_SolutionGenerator, Solution.Monorepo, "@modern-js/monorepo-generator"), _SolutionGenerator);
99970
99931
  var SubSolutionGenerator = (_SubSolutionGenerator = {}, _defineProperty(_SubSolutionGenerator, SubSolution.MWA, "@modern-js/mwa-generator"), _defineProperty(_SubSolutionGenerator, SubSolution.MWATest, "@modern-js/mwa-generator"), _defineProperty(_SubSolutionGenerator, SubSolution.Module, "@modern-js/module-generator"), _defineProperty(_SubSolutionGenerator, SubSolution.InnerModule, "@modern-js/module-generator"), _SubSolutionGenerator);
99971
99932
  var DependenceGenerator = "@modern-js/dependence-generator";
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.2.1",
14
+ "version": "2.3.3",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "main": "./dist/index.js",
17
17
  "files": [
@@ -20,17 +20,17 @@
20
20
  ],
21
21
  "devDependencies": {
22
22
  "@babel/runtime": "^7.18.0",
23
- "@modern-js/codesmith": "^1.4.0",
24
- "@modern-js/codesmith-api-app": "^1.3.0",
25
- "@modern-js/generator-common": "2.2.1",
26
- "@modern-js/dependence-generator": "2.2.1",
27
- "@modern-js/generator-utils": "2.2.1",
23
+ "@modern-js/codesmith": "^1.5.0",
24
+ "@modern-js/codesmith-api-app": "^1.5.0",
25
+ "@modern-js/dependence-generator": "2.3.3",
26
+ "@modern-js/generator-common": "2.3.3",
27
+ "@modern-js/generator-utils": "2.3.3",
28
+ "@scripts/build": "1.18.0",
29
+ "@scripts/jest-config": "1.18.0",
28
30
  "@types/jest": "^27",
29
31
  "@types/node": "^14",
30
- "typescript": "^4",
31
- "@scripts/build": "1.15.0",
32
32
  "jest": "^27",
33
- "@scripts/jest-config": "1.15.0"
33
+ "typescript": "^4"
34
34
  },
35
35
  "sideEffects": false,
36
36
  "modernConfig": {