@modern-js/monorepo-tools 1.4.5 → 1.4.8-alpha.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # @modern-js/monorepo-tools
2
2
 
3
+ ## 1.4.8-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - eeedc8005: feat: add plugin-jarvis to dependencies of solutions
8
+ - Updated dependencies [9cd364e06]
9
+ - Updated dependencies [9cd364e06]
10
+ - Updated dependencies [f29e9bacf]
11
+ - Updated dependencies [1a5759578]
12
+ - Updated dependencies [f29e9bacf]
13
+ - Updated dependencies [a90bc96bd]
14
+ - @modern-js/utils@1.7.9-alpha.0
15
+ - @modern-js/core@1.12.2-alpha.0
16
+ - @modern-js/plugin-jarvis@1.2.14-alpha.0
17
+ - @modern-js/plugin@1.4.0-alpha.0
18
+ - @modern-js/plugin-changeset@1.3.1-alpha.0
19
+ - @modern-js/plugin-i18n@1.2.8-alpha.0
20
+ - @modern-js/new-action@1.3.11-alpha.0
21
+
22
+ ## 1.4.7
23
+
24
+ ### Patch Changes
25
+
26
+ - a1198d509: feat: bump babel 7.18.0
27
+ - Updated dependencies [8d508c6ed]
28
+ - Updated dependencies [0eff2473c]
29
+ - Updated dependencies [a1198d509]
30
+ - Updated dependencies [f25d6a62e]
31
+ - Updated dependencies [a18926bbd]
32
+ - Updated dependencies [c7e38b4e6]
33
+ - Updated dependencies [8f7c0f898]
34
+ - @modern-js/core@1.11.2
35
+ - @modern-js/i18n-cli-language-detector@1.2.4
36
+ - @modern-js/plugin-changeset@1.2.8
37
+ - @modern-js/plugin-i18n@1.2.7
38
+ - @modern-js/new-action@1.3.10
39
+ - @modern-js/plugin@1.3.6
40
+
41
+ ## 1.4.6
42
+
43
+ ### Patch Changes
44
+
45
+ - d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
46
+ - Updated dependencies [d5913bd96]
47
+ - Updated dependencies [d32f35134]
48
+ - Updated dependencies [d9d398e16]
49
+ - Updated dependencies [6ae4a34ae]
50
+ - Updated dependencies [b80229c79]
51
+ - Updated dependencies [948cc4436]
52
+ - @modern-js/plugin@1.3.4
53
+ - @modern-js/core@1.10.2
54
+ - @modern-js/i18n-cli-language-detector@1.2.3
55
+ - @modern-js/plugin-changeset@1.2.7
56
+ - @modern-js/plugin-i18n@1.2.6
57
+ - @modern-js/new-action@1.3.9
58
+ - @modern-js/utils@1.7.3
59
+
3
60
  ## 1.4.5
4
61
 
5
62
  ### Patch Changes
@@ -1,6 +1,9 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  export class EdgeManager {
2
4
  constructor() {
3
- this._dependencyEdgeHash = void 0;
5
+ _defineProperty(this, "_dependencyEdgeHash", void 0);
6
+
4
7
  this._dependencyEdgeHash = {};
5
8
  }
6
9
 
@@ -12,14 +12,16 @@ import { recursiveGetDependency, sortProjects } from "./utils";
12
12
  export class DagOperator {
13
13
  // 排序好的项目列表
14
14
  constructor(projects, projectsMap) {
15
- this._projects = void 0;
16
- this._projectsMap = void 0;
17
- this._sortedProjects = void 0;
15
+ _defineProperty(this, "_projects", void 0);
18
16
 
19
- this._createTask = (project, task) => async (stopTask = () => undefined) => {
17
+ _defineProperty(this, "_projectsMap", void 0);
18
+
19
+ _defineProperty(this, "_sortedProjects", void 0);
20
+
21
+ _defineProperty(this, "_createTask", (project, task) => async (stopTask = () => undefined) => {
20
22
  await task(project, project.dependency || [], () => stopTask());
21
23
  return project.name;
22
- };
24
+ });
23
25
 
24
26
  this._projects = projects;
25
27
  this._projectsMap = projectsMap;
@@ -1,3 +1,5 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { EventEmitter } from 'events';
2
4
  import pMap from 'p-map';
3
5
  export class TaskRunner extends EventEmitter {
@@ -5,10 +7,15 @@ export class TaskRunner extends EventEmitter {
5
7
  concurrency
6
8
  }) {
7
9
  super();
8
- this._tasks = void 0;
9
- this._concurrency = void 0;
10
- this._usableConcurrency = void 0;
11
- this._stopFlag = void 0;
10
+
11
+ _defineProperty(this, "_tasks", void 0);
12
+
13
+ _defineProperty(this, "_concurrency", void 0);
14
+
15
+ _defineProperty(this, "_usableConcurrency", void 0);
16
+
17
+ _defineProperty(this, "_stopFlag", void 0);
18
+
12
19
  this._tasks = tasks;
13
20
  this._concurrency = concurrency || TaskRunner.DefaultConcurrency;
14
21
  this._usableConcurrency = this._concurrency;
@@ -59,5 +66,7 @@ export class TaskRunner extends EventEmitter {
59
66
  }
60
67
 
61
68
  }
62
- TaskRunner.DefaultConcurrency = 10;
63
- TaskRunner.TASK_FINISH = 'task-finish';
69
+
70
+ _defineProperty(TaskRunner, "DefaultConcurrency", 10);
71
+
72
+ _defineProperty(TaskRunner, "TASK_FINISH", 'task-finish');
@@ -8,10 +8,14 @@ import * as path from 'path';
8
8
  import { globby } from '@modern-js/utils';
9
9
  export class WatchedProjectsState {
10
10
  constructor(fromNodes, config) {
11
- this._config = void 0;
12
- this._fromNodes = void 0;
13
- this._watchProjects = void 0;
14
- this._projectsFileMap = void 0;
11
+ _defineProperty(this, "_config", void 0);
12
+
13
+ _defineProperty(this, "_fromNodes", void 0);
14
+
15
+ _defineProperty(this, "_watchProjects", void 0);
16
+
17
+ _defineProperty(this, "_projectsFileMap", void 0);
18
+
15
19
  this._fromNodes = fromNodes;
16
20
  this._config = config;
17
21
  this._projectsFileMap = new Map();
@@ -1,11 +1,12 @@
1
1
  import ChangesetPlugin from '@modern-js/plugin-changeset';
2
+ import LintPlugin from '@modern-js/plugin-jarvis';
2
3
  import { i18n } from "./locale";
3
4
  import { newCli, deployCli, clearCli } from "./cli";
4
5
  import { getLocaleLanguage } from "./utils/language";
5
6
  import { hooks } from "./hooks";
6
7
  export default (() => ({
7
8
  name: '@modern-js/monorepo-tools',
8
- usePlugins: [ChangesetPlugin()],
9
+ usePlugins: [ChangesetPlugin(), LintPlugin()],
9
10
  registerHook: hooks,
10
11
  setup: api => {
11
12
  const locale = getLocaleLanguage();
@@ -1,3 +1,5 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { Signale } from '@modern-js/utils';
2
4
  import { formatLog } from "./utils";
3
5
 
@@ -37,10 +39,14 @@ const createListenHandler = (name, config) => {
37
39
 
38
40
  export class MultitasksLogger {
39
41
  constructor() {
40
- this._taskNameList = void 0;
41
- this._taskStdoutListenerMap = void 0;
42
- this._taskStderrListenerMap = void 0;
43
- this._taskLogConfigMap = void 0;
42
+ _defineProperty(this, "_taskNameList", void 0);
43
+
44
+ _defineProperty(this, "_taskStdoutListenerMap", void 0);
45
+
46
+ _defineProperty(this, "_taskStderrListenerMap", void 0);
47
+
48
+ _defineProperty(this, "_taskLogConfigMap", void 0);
49
+
44
50
  this._taskNameList = [];
45
51
  this._taskStdoutListenerMap = new Map();
46
52
  this._taskStderrListenerMap = new Map();
@@ -1,8 +1,13 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  export class Package {
2
4
  constructor(packageJson, packageConfigPath, rootPath) {
3
- this.json = void 0;
4
- this.configPath = void 0;
5
- this.rootPath = void 0;
5
+ _defineProperty(this, "json", void 0);
6
+
7
+ _defineProperty(this, "configPath", void 0);
8
+
9
+ _defineProperty(this, "rootPath", void 0);
10
+
6
11
  this.configPath = packageConfigPath;
7
12
  this.rootPath = rootPath;
8
13
  this.json = packageJson;
@@ -5,9 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.EdgeManager = void 0;
7
7
 
8
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+
8
10
  class EdgeManager {
9
11
  constructor() {
10
- this._dependencyEdgeHash = void 0;
12
+ _defineProperty(this, "_dependencyEdgeHash", void 0);
13
+
11
14
  this._dependencyEdgeHash = {};
12
15
  }
13
16
 
@@ -26,14 +26,16 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
26
26
  class DagOperator {
27
27
  // 排序好的项目列表
28
28
  constructor(projects, projectsMap) {
29
- this._projects = void 0;
30
- this._projectsMap = void 0;
31
- this._sortedProjects = void 0;
29
+ _defineProperty(this, "_projects", void 0);
32
30
 
33
- this._createTask = (project, task) => async (stopTask = () => undefined) => {
31
+ _defineProperty(this, "_projectsMap", void 0);
32
+
33
+ _defineProperty(this, "_sortedProjects", void 0);
34
+
35
+ _defineProperty(this, "_createTask", (project, task) => async (stopTask = () => undefined) => {
34
36
  await task(project, project.dependency || [], () => stopTask());
35
37
  return project.name;
36
- };
38
+ });
37
39
 
38
40
  this._projects = projects;
39
41
  this._projectsMap = projectsMap;
@@ -11,15 +11,22 @@ var _pMap = _interopRequireDefault(require("p-map"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+
14
16
  class TaskRunner extends _events.EventEmitter {
15
17
  constructor(tasks, {
16
18
  concurrency
17
19
  }) {
18
20
  super();
19
- this._tasks = void 0;
20
- this._concurrency = void 0;
21
- this._usableConcurrency = void 0;
22
- this._stopFlag = void 0;
21
+
22
+ _defineProperty(this, "_tasks", void 0);
23
+
24
+ _defineProperty(this, "_concurrency", void 0);
25
+
26
+ _defineProperty(this, "_usableConcurrency", void 0);
27
+
28
+ _defineProperty(this, "_stopFlag", void 0);
29
+
23
30
  this._tasks = tasks;
24
31
  this._concurrency = concurrency || TaskRunner.DefaultConcurrency;
25
32
  this._usableConcurrency = this._concurrency;
@@ -72,5 +79,7 @@ class TaskRunner extends _events.EventEmitter {
72
79
  }
73
80
 
74
81
  exports.TaskRunner = TaskRunner;
75
- TaskRunner.DefaultConcurrency = 10;
76
- TaskRunner.TASK_FINISH = 'task-finish';
82
+
83
+ _defineProperty(TaskRunner, "DefaultConcurrency", 10);
84
+
85
+ _defineProperty(TaskRunner, "TASK_FINISH", 'task-finish');
@@ -21,10 +21,14 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
21
21
 
22
22
  class WatchedProjectsState {
23
23
  constructor(fromNodes, config) {
24
- this._config = void 0;
25
- this._fromNodes = void 0;
26
- this._watchProjects = void 0;
27
- this._projectsFileMap = void 0;
24
+ _defineProperty(this, "_config", void 0);
25
+
26
+ _defineProperty(this, "_fromNodes", void 0);
27
+
28
+ _defineProperty(this, "_watchProjects", void 0);
29
+
30
+ _defineProperty(this, "_projectsFileMap", void 0);
31
+
28
32
  this._fromNodes = fromNodes;
29
33
  this._config = config;
30
34
  this._projectsFileMap = new Map();
@@ -7,6 +7,8 @@ exports.default = void 0;
7
7
 
8
8
  var _pluginChangeset = _interopRequireDefault(require("@modern-js/plugin-changeset"));
9
9
 
10
+ var _pluginJarvis = _interopRequireDefault(require("@modern-js/plugin-jarvis"));
11
+
10
12
  var _locale = require("./locale");
11
13
 
12
14
  var _cli = require("./cli");
@@ -19,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
21
 
20
22
  var _default = () => ({
21
23
  name: '@modern-js/monorepo-tools',
22
- usePlugins: [(0, _pluginChangeset.default)()],
24
+ usePlugins: [(0, _pluginChangeset.default)(), (0, _pluginJarvis.default)()],
23
25
  registerHook: _hooks.hooks,
24
26
  setup: api => {
25
27
  const locale = (0, _language.getLocaleLanguage)();
@@ -9,6 +9,8 @@ var _utils = require("@modern-js/utils");
9
9
 
10
10
  var _utils2 = require("./utils");
11
11
 
12
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+
12
14
  const createLogger = (name, config) => {
13
15
  const options = {
14
16
  scope: config.label ? config.label + name : name,
@@ -45,10 +47,14 @@ const createListenHandler = (name, config) => {
45
47
 
46
48
  class MultitasksLogger {
47
49
  constructor() {
48
- this._taskNameList = void 0;
49
- this._taskStdoutListenerMap = void 0;
50
- this._taskStderrListenerMap = void 0;
51
- this._taskLogConfigMap = void 0;
50
+ _defineProperty(this, "_taskNameList", void 0);
51
+
52
+ _defineProperty(this, "_taskStdoutListenerMap", void 0);
53
+
54
+ _defineProperty(this, "_taskStderrListenerMap", void 0);
55
+
56
+ _defineProperty(this, "_taskLogConfigMap", void 0);
57
+
52
58
  this._taskNameList = [];
53
59
  this._taskStdoutListenerMap = new Map();
54
60
  this._taskStderrListenerMap = new Map();
@@ -5,11 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Package = void 0;
7
7
 
8
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+
8
10
  class Package {
9
11
  constructor(packageJson, packageConfigPath, rootPath) {
10
- this.json = void 0;
11
- this.configPath = void 0;
12
- this.rootPath = void 0;
12
+ _defineProperty(this, "json", void 0);
13
+
14
+ _defineProperty(this, "configPath", void 0);
15
+
16
+ _defineProperty(this, "rootPath", void 0);
17
+
13
18
  this.configPath = packageConfigPath;
14
19
  this.rootPath = rootPath;
15
20
  this.json = packageJson;
@@ -1,2 +1,2 @@
1
1
  import type { Command } from '@modern-js/utils';
2
- export declare const newCli: (program: Command, locale?: string | undefined) => void;
2
+ export declare const newCli: (program: Command, locale?: string) => void;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import type { ChildProcess } from 'child_process';
3
4
  export interface ITaskLogProviderConfig {
4
5
  stdout: ChildProcess['stdout'] | NodeJS.ReadStream;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.4.5",
14
+ "version": "1.4.8-alpha.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -35,14 +35,15 @@
35
35
  "modern": "./bin/modern.js"
36
36
  },
37
37
  "dependencies": {
38
- "@modern-js/core": "^1.10.1",
39
- "@babel/runtime": "^7",
40
- "@modern-js/i18n-cli-language-detector": "^1.2.2",
41
- "@modern-js/new-action": "^1.3.8",
42
- "@modern-js/plugin": "^1.3.3",
43
- "@modern-js/plugin-changeset": "^1.2.6",
44
- "@modern-js/plugin-i18n": "^1.2.5",
45
- "@modern-js/utils": "^1.7.2",
38
+ "@modern-js/core": "^1.12.2-alpha.0",
39
+ "@babel/runtime": "^7.18.0",
40
+ "@modern-js/i18n-cli-language-detector": "^1.2.4",
41
+ "@modern-js/new-action": "^1.3.11-alpha.0",
42
+ "@modern-js/plugin": "^1.4.0-alpha.0",
43
+ "@modern-js/plugin-changeset": "^1.3.1-alpha.0",
44
+ "@modern-js/plugin-i18n": "^1.2.8-alpha.0",
45
+ "@modern-js/plugin-jarvis": "^1.2.14-alpha.0",
46
+ "@modern-js/utils": "^1.7.9-alpha.0",
46
47
  "@rushstack/node-core-library": "^3.39.1",
47
48
  "@rushstack/package-deps-hash": "^3.0.54",
48
49
  "anymatch": "^3.1.2",
@@ -52,7 +53,7 @@
52
53
  "devDependencies": {
53
54
  "@scripts/build": "0.0.0",
54
55
  "@scripts/jest-config": "0.0.0",
55
- "@types/jest": "^26",
56
+ "@types/jest": "^27",
56
57
  "@types/md5": "^2.3.1",
57
58
  "@types/node": "^14",
58
59
  "@types/react": "^17",
@@ -70,10 +71,33 @@
70
71
  "registry": "https://registry.npmjs.org/",
71
72
  "access": "public"
72
73
  },
74
+ "wireit": {
75
+ "build": {
76
+ "command": "modern build",
77
+ "files": [
78
+ "src/**/*",
79
+ "tsconfig.json",
80
+ "package.json"
81
+ ],
82
+ "output": [
83
+ "dist/**/*"
84
+ ]
85
+ },
86
+ "test": {
87
+ "command": "jest --passWithNoTests",
88
+ "files": [
89
+ "src/**/*",
90
+ "tsconfig.json",
91
+ "package.json",
92
+ "tests/**/*"
93
+ ],
94
+ "output": []
95
+ }
96
+ },
73
97
  "scripts": {
74
98
  "new": "modern new",
75
- "build": "modern build",
76
- "test": "jest --passWithNoTests"
99
+ "build": "wireit",
100
+ "test": "wireit"
77
101
  },
78
102
  "readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
79
103
  }
package/.eslintrc.js DELETED
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ['@modern-js'],
4
- parserOptions: {
5
- tsconfigRootDir: __dirname,
6
- project: ['./tsconfig.json'],
7
- },
8
- };
package/jest.config.js DELETED
@@ -1,7 +0,0 @@
1
- const sharedConfig = require('@scripts/jest-config');
2
-
3
- /** @type {import('@jest/types').Config.InitialOptions} */
4
- module.exports = {
5
- ...sharedConfig,
6
- rootDir: __dirname,
7
- };
package/modern.config.js DELETED
@@ -1,2 +0,0 @@
1
- /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {};
package/tsconfig.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": false,
5
- "jsx": "preserve",
6
- "baseUrl": "./",
7
- "isolatedModules": true,
8
- "paths": {}
9
- },
10
- "include": ["src"]
11
- }