@teams-max/mwsp 1.0.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.
Files changed (67) hide show
  1. package/README.md +3 -0
  2. package/bin/mwsp.js +36 -0
  3. package/es/cli/build.d.ts +2 -0
  4. package/es/cli/build.js +82 -0
  5. package/es/cli/cli.d.ts +1 -0
  6. package/es/cli/cli.js +42 -0
  7. package/es/cli/dev.d.ts +1 -0
  8. package/es/cli/dev.js +44 -0
  9. package/es/cli/start.d.ts +2 -0
  10. package/es/cli/start.js +46 -0
  11. package/es/cli/update.d.ts +2 -0
  12. package/es/cli/update.js +38 -0
  13. package/es/index.d.ts +1 -0
  14. package/es/index.js +1 -0
  15. package/es/internal/buildNotify.d.ts +10 -0
  16. package/es/internal/buildNotify.js +123 -0
  17. package/es/internal/cross-spawn/LICENSE +21 -0
  18. package/es/internal/cross-spawn/index.d.ts +39 -0
  19. package/es/internal/cross-spawn/index.js +512 -0
  20. package/es/internal/cross-spawn/package.json +1 -0
  21. package/es/internal/datetimeFormat.d.ts +9 -0
  22. package/es/internal/datetimeFormat.js +96 -0
  23. package/es/internal/exec.d.ts +1 -0
  24. package/es/internal/exec.js +27 -0
  25. package/es/internal/execa/LICENSE +9 -0
  26. package/es/internal/execa/index.d.ts +534 -0
  27. package/es/internal/execa/index.js +1870 -0
  28. package/es/internal/execa/package.json +1 -0
  29. package/es/internal/merge-stream/LICENSE +21 -0
  30. package/es/internal/merge-stream/index.d.ts +19 -0
  31. package/es/internal/merge-stream/index.js +68 -0
  32. package/es/internal/merge-stream/package.json +1 -0
  33. package/es/internal/utils.d.ts +14 -0
  34. package/es/internal/utils.js +90 -0
  35. package/lib/cli/build.d.ts +2 -0
  36. package/lib/cli/build.js +84 -0
  37. package/lib/cli/cli.d.ts +1 -0
  38. package/lib/cli/cli.js +60 -0
  39. package/lib/cli/dev.d.ts +1 -0
  40. package/lib/cli/dev.js +62 -0
  41. package/lib/cli/start.d.ts +2 -0
  42. package/lib/cli/start.js +59 -0
  43. package/lib/cli/update.d.ts +2 -0
  44. package/lib/cli/update.js +50 -0
  45. package/lib/index.d.ts +1 -0
  46. package/lib/index.js +29 -0
  47. package/lib/internal/buildNotify.d.ts +10 -0
  48. package/lib/internal/buildNotify.js +112 -0
  49. package/lib/internal/cross-spawn/LICENSE +21 -0
  50. package/lib/internal/cross-spawn/index.d.ts +39 -0
  51. package/lib/internal/cross-spawn/index.js +465 -0
  52. package/lib/internal/cross-spawn/package.json +1 -0
  53. package/lib/internal/datetimeFormat.d.ts +9 -0
  54. package/lib/internal/datetimeFormat.js +106 -0
  55. package/lib/internal/exec.d.ts +1 -0
  56. package/lib/internal/exec.js +60 -0
  57. package/lib/internal/execa/LICENSE +9 -0
  58. package/lib/internal/execa/index.d.ts +534 -0
  59. package/lib/internal/execa/index.js +1579 -0
  60. package/lib/internal/execa/package.json +1 -0
  61. package/lib/internal/merge-stream/LICENSE +21 -0
  62. package/lib/internal/merge-stream/index.d.ts +19 -0
  63. package/lib/internal/merge-stream/index.js +62 -0
  64. package/lib/internal/merge-stream/package.json +1 -0
  65. package/lib/internal/utils.d.ts +14 -0
  66. package/lib/internal/utils.js +100 -0
  67. package/package.json +44 -0
@@ -0,0 +1 @@
1
+ {"name":"execa","main":"index.js","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","types":"index.d.ts"}
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Stephen Sugden <me@stephensugden.com> (stephensugden.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ // Type definitions for merge-stream 1.1
2
+ // Project: https://github.com/grncdr/merge-stream
3
+ // Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
4
+ // Tom X. Tobin <https://github.com/tomxtobin>
5
+ // Daniel Zazula <https://github.com/daniel-zazula>
6
+ // Daniel Cassidy <https://github.com/djcsdy>
7
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
8
+
9
+ /// <reference types="node"/>
10
+
11
+ interface MergedStream extends NodeJS.ReadWriteStream {
12
+ add(source: NodeJS.ReadableStream | ReadonlyArray<NodeJS.ReadableStream>): MergedStream;
13
+ isEmpty(): boolean;
14
+ }
15
+
16
+ declare function merge<T extends NodeJS.ReadableStream>(
17
+ ...streams: Array<T | ReadonlyArray<T>>
18
+ ): MergedStream;
19
+ export = merge;
@@ -0,0 +1,62 @@
1
+ // src/internal/merge-stream/index.js
2
+ module.exports = (() => {
3
+ "use strict";
4
+ var e = {
5
+ 621: (e2, r2, t) => {
6
+ const { PassThrough: n } = t(413);
7
+ e2.exports = function() {
8
+ var e3 = [];
9
+ var r3 = new n({ objectMode: true });
10
+ r3.setMaxListeners(0);
11
+ r3.add = add;
12
+ r3.isEmpty = isEmpty;
13
+ r3.on("unpipe", remove);
14
+ Array.prototype.slice.call(arguments).forEach(add);
15
+ return r3;
16
+ function add(t2) {
17
+ if (Array.isArray(t2)) {
18
+ t2.forEach(add);
19
+ return this;
20
+ }
21
+ e3.push(t2);
22
+ t2.once("end", remove.bind(null, t2));
23
+ t2.once("error", r3.emit.bind(r3, "error"));
24
+ t2.pipe(r3, { end: false });
25
+ return this;
26
+ }
27
+ function isEmpty() {
28
+ return e3.length == 0;
29
+ }
30
+ function remove(t2) {
31
+ e3 = e3.filter(function(e4) {
32
+ return e4 !== t2;
33
+ });
34
+ if (!e3.length && r3.readable) {
35
+ r3.end();
36
+ }
37
+ }
38
+ };
39
+ },
40
+ 413: (e2) => {
41
+ e2.exports = require("stream");
42
+ }
43
+ };
44
+ var r = {};
45
+ function __nccwpck_require__(t) {
46
+ if (r[t]) {
47
+ return r[t].exports;
48
+ }
49
+ var n = r[t] = { exports: {} };
50
+ var i = true;
51
+ try {
52
+ e[t](n, n.exports, __nccwpck_require__);
53
+ i = false;
54
+ } finally {
55
+ if (i)
56
+ delete r[t];
57
+ }
58
+ return n.exports;
59
+ }
60
+ __nccwpck_require__.ab = __dirname + "/";
61
+ return __nccwpck_require__(621);
62
+ })();
@@ -0,0 +1 @@
1
+ {"name":"merge-stream","main":"index.js","author":"Stephen Sugden <me@stephensugden.com>","license":"MIT","types":"index.d.ts"}
@@ -0,0 +1,14 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import type { SpawnSyncOptions } from 'child_process';
4
+ import 'zx/globals';
5
+ export declare function assert(v: unknown, message: string): void;
6
+ export declare function setExcludeFolder(opts: {
7
+ cwd: string;
8
+ pkg: string;
9
+ dirName?: string;
10
+ folders?: string[];
11
+ }): void;
12
+ export declare function spawnSync(cmd: string, opts: SpawnSyncOptions, status?: string): import("child_process").SpawnSyncReturns<string | Buffer>;
13
+ export declare function toArray(v: unknown): any[];
14
+ export declare function gitHeadReset(): Promise<void>;
@@ -0,0 +1,100 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/internal/utils.ts
30
+ var utils_exports = {};
31
+ __export(utils_exports, {
32
+ assert: () => assert,
33
+ gitHeadReset: () => gitHeadReset,
34
+ setExcludeFolder: () => setExcludeFolder,
35
+ spawnSync: () => spawnSync,
36
+ toArray: () => toArray
37
+ });
38
+ module.exports = __toCommonJS(utils_exports);
39
+ var import_cross_spawn = __toESM(require("@umijs/utils/compiled/cross-spawn"));
40
+ var logger = __toESM(require("@umijs/utils/dist/logger"));
41
+ var import_fs = require("fs");
42
+ var import_path = require("path");
43
+ var import_globals = require("zx/globals");
44
+ function assert(v, message) {
45
+ if (!v) {
46
+ logger.error(message);
47
+ process.exit(1);
48
+ }
49
+ }
50
+ function setExcludeFolder(opts) {
51
+ const dirName = opts.dirName || "packages";
52
+ const folders = opts.folders || ["dist", "compiled"];
53
+ if (!(0, import_fs.existsSync)((0, import_path.join)(opts.cwd, ".idea")))
54
+ return;
55
+ const configPath = (0, import_path.join)(opts.cwd, ".idea", "umi-next.iml");
56
+ let content = (0, import_fs.readFileSync)(configPath, "utf-8");
57
+ for (const folder of folders) {
58
+ const excludeContent = `<excludeFolder url='file://$MODULE_DIR$/${dirName}/${opts.pkg}/${folder}' />`;
59
+ const replaceMatcher = `<content url="file://$MODULE_DIR$">`;
60
+ if (!content.includes(excludeContent)) {
61
+ content = content.replace(
62
+ replaceMatcher,
63
+ `${replaceMatcher}
64
+ ${excludeContent}`
65
+ );
66
+ }
67
+ }
68
+ (0, import_fs.writeFileSync)(configPath, content, "utf-8");
69
+ }
70
+ function spawnSync(cmd, opts, status) {
71
+ const result = import_cross_spawn.default.sync(cmd, {
72
+ shell: true,
73
+ stdio: "inherit",
74
+ ...opts
75
+ });
76
+ if (result.status !== 0 && status !== "continue") {
77
+ logger.error(`Execute command error (${cmd})`);
78
+ process.exit(1);
79
+ }
80
+ return result;
81
+ }
82
+ function toArray(v) {
83
+ if (Array.isArray(v)) {
84
+ return v;
85
+ }
86
+ return [v];
87
+ }
88
+ async function gitHeadReset() {
89
+ $.verbose = false;
90
+ await $`git reset HEAD -- packages/app-* .gitmodules`;
91
+ $.verbose = true;
92
+ }
93
+ // Annotate the CommonJS export names for ESM import in node:
94
+ 0 && (module.exports = {
95
+ assert,
96
+ gitHeadReset,
97
+ setExcludeFolder,
98
+ spawnSync,
99
+ toArray
100
+ });
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@teams-max/mwsp",
3
+ "version": "1.0.0",
4
+ "description": "@teams-max/mwsp",
5
+ "homepage": "https://gitlab.daikuan.qihoo.net/efficacy-fe/teams-max/-/tree/master/packages/mwsp",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://gitlab.daikuan.qihoo.net/efficacy-fe/teams-max"
9
+ },
10
+ "main": "lib/index.js",
11
+ "types": "lib/index.d.ts",
12
+ "bin": {
13
+ "mwsp": "bin/mwsp.js"
14
+ },
15
+ "files": [
16
+ "lib",
17
+ "es",
18
+ "compiled"
19
+ ],
20
+ "scripts": {
21
+ "build": "max-scripts father build",
22
+ "build:deps": "max-scripts bundleDeps",
23
+ "dev": "max-scripts father dev"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "license": "ISC",
29
+ "dependencies": {
30
+ "@umijs/utils": "^4.0.0",
31
+ "crypto-js": "^4.1.1",
32
+ "esno": "^0.16.3",
33
+ "umi-request": "^1.4.0",
34
+ "v8-compile-cache": "2.3.0",
35
+ "zx": "^4"
36
+ },
37
+ "authors": [
38
+ "zhangxiaoyang <zhangxiaoyang-jk@360shuke.com> (https://v.src.corp.qihoo.net/j-zhangxiaoyang-jk)",
39
+ "liuxiangdong <liuxiangdong1-jk@360shuke.com> (https://v.src.corp.qihoo.net/j-liuxiangdong1-jk)"
40
+ ],
41
+ "devDependencies": {
42
+ "@types/crypto-js": "^4.1.1"
43
+ }
44
+ }