@modern-js/generator-common 3.4.15 → 3.4.17

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 (44) hide show
  1. package/dist/cjs/common/packagePath.js +1 -1
  2. package/dist/cjs/common/solution.js +2 -1
  3. package/dist/cjs/locale/index.js +1 -1
  4. package/dist/cjs/mwa/entry.js +1 -1
  5. package/dist/cjs/newAction/module/index.js +1 -1
  6. package/dist/cjs/newAction/mwa/index.js +1 -1
  7. package/dist/esm/common/packagePath.js +1 -1
  8. package/dist/esm/common/solution.js +2 -1
  9. package/dist/esm/expand/generator.js +1 -1
  10. package/dist/esm/locale/index.js +1 -1
  11. package/dist/esm/module/project.js +1 -1
  12. package/dist/esm/mwa/bff.js +1 -1
  13. package/dist/esm/mwa/entry.js +1 -1
  14. package/dist/esm/mwa/project.js +1 -1
  15. package/dist/esm/newAction/module/index.js +1 -1
  16. package/dist/esm/newAction/mwa/index.js +1 -1
  17. package/dist/esm-node/common/packagePath.js +1 -1
  18. package/dist/esm-node/common/solution.js +2 -1
  19. package/dist/esm-node/expand/generator.js +1 -1
  20. package/dist/esm-node/locale/index.js +1 -1
  21. package/dist/esm-node/module/project.js +1 -1
  22. package/dist/esm-node/mwa/bff.js +1 -1
  23. package/dist/esm-node/mwa/entry.js +1 -1
  24. package/dist/esm-node/mwa/project.js +1 -1
  25. package/dist/esm-node/newAction/module/index.js +1 -1
  26. package/dist/esm-node/newAction/mwa/index.js +1 -1
  27. package/dist/types/base/project.d.ts +1 -1
  28. package/dist/types/common/boolean.d.ts +1 -1
  29. package/dist/types/common/language.d.ts +1 -1
  30. package/dist/types/common/packageManager.d.ts +1 -1
  31. package/dist/types/common/packageName.d.ts +1 -1
  32. package/dist/types/common/packagePath.d.ts +1 -1
  33. package/dist/types/common/solution.d.ts +1 -1
  34. package/dist/types/expand/generator.d.ts +1 -1
  35. package/dist/types/index.d.ts +1 -1
  36. package/dist/types/module/project.d.ts +1 -1
  37. package/dist/types/monorepo/project.d.ts +1 -1
  38. package/dist/types/mwa/bff.d.ts +1 -1
  39. package/dist/types/mwa/common.d.ts +1 -1
  40. package/dist/types/mwa/entry.d.ts +1 -1
  41. package/dist/types/mwa/project.d.ts +1 -1
  42. package/dist/types/newAction/module/index.d.ts +1 -1
  43. package/dist/types/newAction/mwa/index.d.ts +1 -1
  44. package/package.json +8 -8
@@ -23,7 +23,7 @@ __export(packagePath_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(packagePath_exports);
25
25
  var import_locale = require("../locale");
26
- const PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
26
+ const PackagePathRegex = /^[a-z0-9-_]+[a-z0-9-\/_]*$/;
27
27
  const getPackagePathSchema = (extra) => {
28
28
  return {
29
29
  type: "string",
@@ -74,7 +74,8 @@ const getSolutionSchema = (extra = {}) => {
74
74
  };
75
75
  };
76
76
  const getScenesSchema = (extra = {}) => {
77
- const hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
77
+ var _extra_customPlugin;
78
+ const hasPlugin = (extra === null || extra === void 0 ? void 0 : (_extra_customPlugin = extra.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : _extra_customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution]) && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
78
79
  return {
79
80
  type: "object",
80
81
  properties: hasPlugin ? {
@@ -23,8 +23,8 @@ __export(locale_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(locale_exports);
25
25
  var import_plugin_i18n = require("@modern-js/plugin-i18n");
26
- var import_zh = require("./zh");
27
26
  var import_en = require("./en");
27
+ var import_zh = require("./zh");
28
28
  const i18n = new import_plugin_i18n.I18n();
29
29
  const localeKeys = i18n.init("en", {
30
30
  zh: import_zh.ZH_LOCALE,
@@ -24,8 +24,8 @@ __export(entry_exports, {
24
24
  getEntrySchemaProperties: () => getEntrySchemaProperties
25
25
  });
26
26
  module.exports = __toCommonJS(entry_exports);
27
- var import_locale = require("../locale");
28
27
  var import_common = require("../common");
28
+ var import_locale = require("../locale");
29
29
  const getEntryNameSchema = (extra = {}) => {
30
30
  return {
31
31
  type: "string",
@@ -31,8 +31,8 @@ __export(module_exports, {
31
31
  getModuleNewActionSchema: () => getModuleNewActionSchema
32
32
  });
33
33
  module.exports = __toCommonJS(module_exports);
34
- var import_common = require("../common");
35
34
  var import_locale = require("../../locale");
35
+ var import_common = require("../common");
36
36
  const ModuleActionTypes = [
37
37
  import_common.ActionType.Function
38
38
  ];
@@ -36,9 +36,9 @@ __export(mwa_exports, {
36
36
  getMWANewActionSchema: () => getMWANewActionSchema
37
37
  });
38
38
  module.exports = __toCommonJS(mwa_exports);
39
+ var import_locale = require("../../locale");
39
40
  var import_common = require("../../mwa/common");
40
41
  var import_common2 = require("../common");
41
- var import_locale = require("../../locale");
42
42
  const MWAActionTypes = [
43
43
  import_common2.ActionType.Element,
44
44
  import_common2.ActionType.Function,
@@ -1,5 +1,5 @@
1
1
  import { i18n, localeKeys } from "../locale";
2
- var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
2
+ var PackagePathRegex = /^[a-z0-9-_]+[a-z0-9-\/_]*$/;
3
3
  var getPackagePathSchema = function(extra) {
4
4
  return {
5
5
  type: "string",
@@ -46,7 +46,8 @@ var getSolutionSchema = function() {
46
46
  };
47
47
  var getScenesSchema = function() {
48
48
  var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
49
- var hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
49
+ var _extra_customPlugin;
50
+ var hasPlugin = (extra === null || extra === void 0 ? void 0 : (_extra_customPlugin = extra.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : _extra_customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution]) && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
50
51
  return {
51
52
  type: "object",
52
53
  properties: hasPlugin ? {
@@ -1,4 +1,4 @@
1
- import { Language, getLanguageSchema, PackageManager, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
1
+ import { Language, PackageManager, getLanguageSchema, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
2
2
  var getGeneratorSchemaProperties = function() {
3
3
  var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
4
4
  return {
@@ -1,6 +1,6 @@
1
1
  import { I18n } from "@modern-js/plugin-i18n";
2
- import { ZH_LOCALE } from "./zh";
3
2
  import { EN_LOCALE } from "./en";
3
+ import { ZH_LOCALE } from "./zh";
4
4
  var i18n = new I18n();
5
5
  var localeKeys = i18n.init("en", {
6
6
  zh: ZH_LOCALE,
@@ -1,4 +1,4 @@
1
- import { Language, getLanguageSchema, PackageManager, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
1
+ import { Language, PackageManager, getLanguageSchema, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
2
2
  var getModuleSchemaProperties = function(extra) {
3
3
  return {
4
4
  packageName: getPackageNameSchema(extra),
@@ -1,5 +1,5 @@
1
1
  import { i18n, localeKeys } from "../locale";
2
- import { getFrameworkSchema, Framework } from "./common";
2
+ import { Framework, getFrameworkSchema } from "./common";
3
3
  var BFFType;
4
4
  (function(BFFType2) {
5
5
  BFFType2["Func"] = "func";
@@ -1,5 +1,5 @@
1
- import { i18n, localeKeys } from "../locale";
2
1
  import { BooleanConfig } from "../common";
2
+ import { i18n, localeKeys } from "../locale";
3
3
  var getEntryNameSchema = function() {
4
4
  var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
5
5
  return {
@@ -1,4 +1,4 @@
1
- import { BooleanConfig, getPackageNameSchema, getPackagePathSchema, Language, getLanguageSchema, PackageManager, getPackageManagerSchema } from "../common";
1
+ import { BooleanConfig, Language, PackageManager, getLanguageSchema, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
2
2
  import { BuildTools, getBuildToolsSchema } from "./common";
3
3
  var getMWASchemaProperties = function(extra) {
4
4
  return {
@@ -1,6 +1,6 @@
1
1
  import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
- import { ActionFunction, ActionFunctionText, ActionType, ActionTypeQuestionText, ActionTypeText } from "../common";
3
2
  import { i18n, localeKeys } from "../../locale";
3
+ import { ActionFunction, ActionFunctionText, ActionType, ActionTypeQuestionText, ActionTypeText } from "../common";
4
4
  var ModuleActionTypes = [
5
5
  ActionType.Function
6
6
  ];
@@ -1,7 +1,7 @@
1
1
  import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
+ import { i18n, localeKeys } from "../../locale";
2
3
  import { Framework } from "../../mwa/common";
3
4
  import { ActionElement, ActionElementText, ActionFunction, ActionFunctionText, ActionRefactor, ActionRefactorText, ActionType, ActionTypeQuestionText, ActionTypeText } from "../common";
4
- import { i18n, localeKeys } from "../../locale";
5
5
  var MWAActionTypes = [
6
6
  ActionType.Element,
7
7
  ActionType.Function,
@@ -1,5 +1,5 @@
1
1
  import { i18n, localeKeys } from "../locale";
2
- const PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
2
+ const PackagePathRegex = /^[a-z0-9-_]+[a-z0-9-\/_]*$/;
3
3
  const getPackagePathSchema = (extra) => {
4
4
  return {
5
5
  type: "string",
@@ -41,7 +41,8 @@ const getSolutionSchema = (extra = {}) => {
41
41
  };
42
42
  };
43
43
  const getScenesSchema = (extra = {}) => {
44
- const hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
44
+ var _extra_customPlugin;
45
+ const hasPlugin = (extra === null || extra === void 0 ? void 0 : (_extra_customPlugin = extra.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : _extra_customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution]) && extra.customPlugin[extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
45
46
  return {
46
47
  type: "object",
47
48
  properties: hasPlugin ? {
@@ -1,4 +1,4 @@
1
- import { Language, getLanguageSchema, PackageManager, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
1
+ import { Language, PackageManager, getLanguageSchema, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
2
2
  const getGeneratorSchemaProperties = (extra = {}) => {
3
3
  return {
4
4
  packageName: getPackageNameSchema(extra),
@@ -1,6 +1,6 @@
1
1
  import { I18n } from "@modern-js/plugin-i18n";
2
- import { ZH_LOCALE } from "./zh";
3
2
  import { EN_LOCALE } from "./en";
3
+ import { ZH_LOCALE } from "./zh";
4
4
  const i18n = new I18n();
5
5
  const localeKeys = i18n.init("en", {
6
6
  zh: ZH_LOCALE,
@@ -1,4 +1,4 @@
1
- import { Language, getLanguageSchema, PackageManager, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
1
+ import { Language, PackageManager, getLanguageSchema, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
2
2
  const getModuleSchemaProperties = (extra) => {
3
3
  return {
4
4
  packageName: getPackageNameSchema(extra),
@@ -1,5 +1,5 @@
1
1
  import { i18n, localeKeys } from "../locale";
2
- import { getFrameworkSchema, Framework } from "./common";
2
+ import { Framework, getFrameworkSchema } from "./common";
3
3
  var BFFType;
4
4
  (function(BFFType2) {
5
5
  BFFType2["Func"] = "func";
@@ -1,5 +1,5 @@
1
- import { i18n, localeKeys } from "../locale";
2
1
  import { BooleanConfig } from "../common";
2
+ import { i18n, localeKeys } from "../locale";
3
3
  const getEntryNameSchema = (extra = {}) => {
4
4
  return {
5
5
  type: "string",
@@ -1,4 +1,4 @@
1
- import { BooleanConfig, getPackageNameSchema, getPackagePathSchema, Language, getLanguageSchema, PackageManager, getPackageManagerSchema } from "../common";
1
+ import { BooleanConfig, Language, PackageManager, getLanguageSchema, getPackageManagerSchema, getPackageNameSchema, getPackagePathSchema } from "../common";
2
2
  import { BuildTools, getBuildToolsSchema } from "./common";
3
3
  const getMWASchemaProperties = (extra) => {
4
4
  return {
@@ -1,5 +1,5 @@
1
- import { ActionFunction, ActionFunctionText, ActionType, ActionTypeQuestionText, ActionTypeText } from "../common";
2
1
  import { i18n, localeKeys } from "../../locale";
2
+ import { ActionFunction, ActionFunctionText, ActionType, ActionTypeQuestionText, ActionTypeText } from "../common";
3
3
  const ModuleActionTypes = [
4
4
  ActionType.Function
5
5
  ];
@@ -1,6 +1,6 @@
1
+ import { i18n, localeKeys } from "../../locale";
1
2
  import { Framework } from "../../mwa/common";
2
3
  import { ActionElement, ActionElementText, ActionFunction, ActionFunctionText, ActionRefactor, ActionRefactorText, ActionType, ActionTypeQuestionText, ActionTypeText } from "../common";
3
- import { i18n, localeKeys } from "../../locale";
4
4
  const MWAActionTypes = [
5
5
  ActionType.Element,
6
6
  ActionType.Function,
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { PackageManager } from '../common';
3
3
  export declare const getBaseSchema: (extra?: Record<string, any>) => Schema;
4
4
  export declare const BaseDefaultConfig: {
@@ -1,4 +1,4 @@
1
- import { SchemaEnum } from '@modern-js/codesmith-formily';
1
+ import type { SchemaEnum } from '@modern-js/codesmith-formily';
2
2
  export declare enum BooleanConfig {
3
3
  NO = "no",
4
4
  YES = "yes"
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  export declare enum Language {
3
3
  TS = "ts",
4
4
  JS = "js"
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  export declare enum PackageManager {
3
3
  Pnpm = "pnpm",
4
4
  Yarn = "yarn",
@@ -1,2 +1,2 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  export declare const getPackageNameSchema: (extra?: Record<string, any>) => Schema;
@@ -1,3 +1,3 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  export declare const PackagePathRegex: RegExp;
3
3
  export declare const getPackagePathSchema: (extra: Record<string, any>) => Schema;
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  export declare enum Solution {
3
3
  MWA = "mwa",
4
4
  Module = "module"
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { Language, PackageManager } from '../common';
3
3
  export declare const getGeneratorSchemaProperties: (extra?: Record<string, any>) => Schema['properties'];
4
4
  export declare const getGeneratorSchema: (extra?: Record<string, any>) => Schema;
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { Solution } from './common';
3
3
  export * from './locale';
4
4
  export * from './common';
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { Language, PackageManager } from '../common';
3
3
  export declare const getModuleSchemaProperties: (extra: Record<string, any>) => Schema['properties'];
4
4
  export declare const getModuleSchema: (extra?: Record<string, any>) => Schema;
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { PackageManager } from '../common';
3
3
  export declare const getMonorepoSchema: (extra?: Record<string, any>) => Schema;
4
4
  export declare const MonorepoDefaultConfig: {
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { Framework } from './common';
3
3
  export declare enum BFFType {
4
4
  Func = "func",
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  export declare enum Framework {
3
3
  Express = "express",
4
4
  Koa = "koa"
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { BooleanConfig } from '../common';
3
3
  export declare const getEntryNameSchema: (extra?: Record<string, any>) => Schema;
4
4
  export declare const getEntrySchemaProperties: (extra: Record<string, any>) => Schema['properties'];
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { BooleanConfig, Language, PackageManager } from '../common';
3
3
  import { BuildTools } from './common';
4
4
  export declare const getMWASchemaProperties: (extra: Record<string, any>) => Schema['properties'];
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { ActionFunction, ActionType } from '../common';
3
3
  export declare const ModuleActionTypes: ActionType[];
4
4
  export declare const ModuleActionFunctions: ActionFunction[];
@@ -1,4 +1,4 @@
1
- import { Schema } from '@modern-js/codesmith-formily';
1
+ import type { Schema } from '@modern-js/codesmith-formily';
2
2
  import { Framework } from '../../mwa/common';
3
3
  import { ActionElement, ActionFunction, ActionRefactor, ActionType } from '../common';
4
4
  export declare const MWAActionTypes: ActionType[];
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.4.15",
18
+ "version": "3.4.17",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -31,20 +31,20 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@modern-js/codesmith-formily": "2.4.0",
34
+ "@modern-js/codesmith-formily": "2.4.1",
35
35
  "@swc/helpers": "0.5.3",
36
- "@modern-js/plugin-i18n": "2.58.1"
36
+ "@modern-js/plugin-i18n": "2.58.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@modern-js/codesmith": "2.4.0",
40
- "@modern-js/codesmith-api-app": "2.4.0",
39
+ "@modern-js/codesmith": "2.4.1",
40
+ "@modern-js/codesmith-api-app": "2.4.1",
41
41
  "@types/jest": "^29",
42
42
  "@types/node": "^14",
43
43
  "jest": "^29",
44
44
  "typescript": "^5",
45
- "@modern-js/utils": "2.58.1",
46
- "@scripts/jest-config": "2.58.1",
47
- "@scripts/build": "2.58.1"
45
+ "@modern-js/utils": "2.58.3",
46
+ "@scripts/build": "2.58.3",
47
+ "@scripts/jest-config": "2.58.3"
48
48
  },
49
49
  "sideEffects": false,
50
50
  "publishConfig": {