@teambit/application 1.0.714 → 1.0.716
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/dist/preview-1755703366849.js +7 -0
- package/dist/run.cmd.d.ts +2 -1
- package/dist/run.cmd.js +44 -6
- package/dist/run.cmd.js.map +1 -1
- package/package.json +14 -12
- package/dist/preview-1755636844321.js +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_application@1.0.716/dist/application.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_application@1.0.716/dist/application.docs.mdx';
|
|
3
|
+
|
|
4
|
+
export const compositions = [compositions_0];
|
|
5
|
+
export const overview = [overview_0];
|
|
6
|
+
|
|
7
|
+
export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
|
package/dist/run.cmd.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ type RunOptions = {
|
|
|
9
9
|
ssr: boolean;
|
|
10
10
|
port: string;
|
|
11
11
|
args: string;
|
|
12
|
+
noBrowser: boolean;
|
|
12
13
|
};
|
|
13
14
|
export declare class RunCmd implements Command {
|
|
14
15
|
/**
|
|
@@ -31,6 +32,6 @@ export declare class RunCmd implements Command {
|
|
|
31
32
|
* access to the extension instance.
|
|
32
33
|
*/
|
|
33
34
|
application: ApplicationMain, logger: Logger);
|
|
34
|
-
wait([appName]: [string], { dev, watch, ssr, port: exactPort, args }: RunOptions): Promise<void>;
|
|
35
|
+
wait([appName]: [string], { dev, watch, ssr, port: exactPort, args, noBrowser }: RunOptions): Promise<void>;
|
|
35
36
|
}
|
|
36
37
|
export {};
|
package/dist/run.cmd.js
CHANGED
|
@@ -4,6 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.RunCmd = void 0;
|
|
7
|
+
function _chalk() {
|
|
8
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
9
|
+
_chalk = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _openBrowser() {
|
|
15
|
+
const data = _interopRequireDefault(require("react-dev-utils/openBrowser"));
|
|
16
|
+
_openBrowser = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
22
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
23
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
24
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -15,7 +30,7 @@ class RunCmd {
|
|
|
15
30
|
application, logger) {
|
|
16
31
|
this.application = application;
|
|
17
32
|
this.logger = logger;
|
|
18
|
-
_defineProperty(this, "name", 'run
|
|
33
|
+
_defineProperty(this, "name", 'run [app-name]');
|
|
19
34
|
_defineProperty(this, "description", "locally run an app component (independent of bit's dev server)");
|
|
20
35
|
_defineProperty(this, "helpUrl", 'reference/apps/apps-overview/');
|
|
21
36
|
_defineProperty(this, "arguments", [{
|
|
@@ -26,23 +41,34 @@ class RunCmd {
|
|
|
26
41
|
_defineProperty(this, "group", 'run-serve');
|
|
27
42
|
_defineProperty(this, "options", [['d', 'dev', 'start the application in dev mode.'], ['p', 'port [port-number]', 'port to run the app on'], ['v', 'verbose', 'show verbose output for inspection and print stack trace'],
|
|
28
43
|
// ['', 'skip-watch', 'avoid running the watch process that compiles components in the background'],
|
|
29
|
-
['w', 'watch', 'watch and compile your components upon changes'], ['a', 'args <argv>', 'the arguments passing to the app. for example, --args="--a=1 --b". don\'t forget to use quotes to wrap the value to escape special characters.']]);
|
|
44
|
+
['w', 'watch', 'watch and compile your components upon changes'], ['n', 'no-browser', 'do not automatically open browser when ready'], ['a', 'args <argv>', 'the arguments passing to the app. for example, --args="--a=1 --b". don\'t forget to use quotes to wrap the value to escape special characters.']]);
|
|
30
45
|
}
|
|
31
46
|
async wait([appName], {
|
|
32
47
|
dev,
|
|
33
48
|
watch,
|
|
34
49
|
ssr,
|
|
35
50
|
port: exactPort,
|
|
36
|
-
args
|
|
51
|
+
args,
|
|
52
|
+
noBrowser
|
|
37
53
|
}) {
|
|
38
|
-
await this.application.loadAllAppsAsAspects();
|
|
54
|
+
const ids = await this.application.loadAllAppsAsAspects();
|
|
55
|
+
if (!ids.length) {
|
|
56
|
+
this.logger.console('no apps found');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
const resolvedApp = appName ? appName : ids.length === 1 ? ids[0].toString() : undefined;
|
|
60
|
+
if (!resolvedApp) {
|
|
61
|
+
const runStr = _chalk().default.cyan(`bit run <app id or name>`);
|
|
62
|
+
this.logger.console(`multiple apps found, please specify one using "${runStr}"`);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
39
65
|
// remove wds logs until refactoring webpack to a worker through the Worker aspect.
|
|
40
66
|
this.logger.off();
|
|
41
67
|
const {
|
|
42
68
|
port,
|
|
43
69
|
errors,
|
|
44
70
|
isOldApi
|
|
45
|
-
} = await this.application.runApp(
|
|
71
|
+
} = await this.application.runApp(resolvedApp, {
|
|
46
72
|
dev,
|
|
47
73
|
watch,
|
|
48
74
|
ssr,
|
|
@@ -55,7 +81,19 @@ class RunCmd {
|
|
|
55
81
|
process.exit(1);
|
|
56
82
|
}
|
|
57
83
|
if (isOldApi) {
|
|
58
|
-
|
|
84
|
+
const url = `http://localhost:${port}`;
|
|
85
|
+
this.logger.console(`${appName} app is running on ${url}`);
|
|
86
|
+
if (!noBrowser && port) {
|
|
87
|
+
(0, _openBrowser().default)(url);
|
|
88
|
+
}
|
|
89
|
+
} else if (port) {
|
|
90
|
+
// New API - also open browser when port is available
|
|
91
|
+
const url = `http://localhost:${port}`;
|
|
92
|
+
// this.logger.console(`${appName} app is running on ${url}`);
|
|
93
|
+
|
|
94
|
+
if (!noBrowser) {
|
|
95
|
+
(0, _openBrowser().default)(url);
|
|
96
|
+
}
|
|
59
97
|
}
|
|
60
98
|
|
|
61
99
|
/**
|
package/dist/run.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RunCmd","constructor","application","logger","
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_openBrowser","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RunCmd","constructor","application","logger","name","description","wait","appName","dev","watch","ssr","port","exactPort","args","noBrowser","ids","loadAllAppsAsAspects","length","console","process","exit","resolvedApp","toString","undefined","runStr","chalk","cyan","off","errors","isOldApi","runApp","errStr","map","err","join","url","openBrowser","on","code","exports"],"sources":["run.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport type { ApplicationMain } from './application.main.runtime';\n\ntype RunOptions = {\n dev: boolean;\n verbose: boolean;\n skipWatch: boolean;\n watch: boolean;\n ssr: boolean;\n port: string;\n args: string;\n noBrowser: boolean;\n};\n\nexport class RunCmd implements Command {\n name = 'run [app-name]';\n description = \"locally run an app component (independent of bit's dev server)\";\n helpUrl = 'reference/apps/apps-overview/';\n arguments = [\n {\n name: 'app-name',\n description:\n \"the app's name is registered by the app (run 'bit app list' to list the names of the available apps)\",\n },\n ];\n alias = 'c';\n group = 'run-serve';\n options = [\n ['d', 'dev', 'start the application in dev mode.'],\n ['p', 'port [port-number]', 'port to run the app on'],\n ['v', 'verbose', 'show verbose output for inspection and print stack trace'],\n // ['', 'skip-watch', 'avoid running the watch process that compiles components in the background'],\n ['w', 'watch', 'watch and compile your components upon changes'],\n ['n', 'no-browser', 'do not automatically open browser when ready'],\n [\n 'a',\n 'args <argv>',\n 'the arguments passing to the app. for example, --args=\"--a=1 --b\". don\\'t forget to use quotes to wrap the value to escape special characters.',\n ],\n ] as CommandOptions;\n\n constructor(\n /**\n * access to the extension instance.\n */\n private application: ApplicationMain,\n\n private logger: Logger\n ) {}\n\n async wait([appName]: [string], { dev, watch, ssr, port: exactPort, args, noBrowser }: RunOptions) {\n const ids = await this.application.loadAllAppsAsAspects();\n if (!ids.length) {\n this.logger.console('no apps found');\n process.exit(1);\n }\n const resolvedApp = appName ? appName : ids.length === 1 ? ids[0].toString() : undefined;\n if (!resolvedApp) {\n const runStr = chalk.cyan(`bit run <app id or name>`);\n this.logger.console(`multiple apps found, please specify one using \"${runStr}\"`);\n process.exit(1);\n }\n // remove wds logs until refactoring webpack to a worker through the Worker aspect.\n this.logger.off();\n const { port, errors, isOldApi } = await this.application.runApp(resolvedApp, {\n dev,\n watch,\n ssr,\n port: +exactPort,\n args,\n });\n\n if (errors) {\n const errStr =\n errors && errors.length ? errors.map((err) => err.toString()).join('\\n') : 'unknown error occurred';\n this.logger.console(errStr);\n process.exit(1);\n }\n\n if (isOldApi) {\n const url = `http://localhost:${port}`;\n this.logger.console(`${appName} app is running on ${url}`);\n\n if (!noBrowser && port) {\n openBrowser(url);\n }\n } else if (port) {\n // New API - also open browser when port is available\n const url = `http://localhost:${port}`;\n // this.logger.console(`${appName} app is running on ${url}`);\n\n if (!noBrowser) {\n openBrowser(url);\n }\n }\n\n /**\n * normally, when running \"bit run <app-name>\", the app is running in the background, which keeps the event loop busy.\n * when the even loop is busy, the process doesn't exit, which is what we're looking for.\n *\n * however, if the app is not running in the background, the event loop is free, and the process exits. this is\n * very confusing to the end user, because there is no error and no message indicating what's happening.\n *\n * this \"beforeExit\" event is a good place to catch this case and print a message to the user.\n * it's better than using \"exit\" event, which can caused by the app itself running \"process.exit\".\n * \"beforeExit\" is called when the event loop is empty and the process is about to exit.\n */\n process.on('beforeExit', (code) => {\n if (code === 0) {\n this.logger.console('no app is running in the background, please check your app');\n }\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsD,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,C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MAClB;IACF,CAAC,MAAM,IAAIxB,IAAI,EAAE;MACf;MACA,MAAMwB,GAAG,GAAG,oBAAoBxB,IAAI,EAAE;MACtC;;MAEA,IAAI,CAACG,SAAS,EAAE;QACd,IAAAsB,sBAAW,EAACD,GAAG,CAAC;MAClB;IACF;;IAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIhB,OAAO,CAACkB,EAAE,CAAC,YAAY,EAAGC,IAAI,IAAK;MACjC,IAAIA,IAAI,KAAK,CAAC,EAAE;QACd,IAAI,CAACnC,MAAM,CAACe,OAAO,CAAC,4DAA4D,CAAC;MACnF;IACF,CAAC,CAAC;EACJ;AACF;AAACqB,OAAA,CAAAvC,MAAA,GAAAA,MAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/application",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.716",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "application",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.716"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
14
|
"p-map-series": "2.1.0",
|
|
15
|
+
"react-dev-utils": "12.0.1",
|
|
15
16
|
"@teambit/lane-id": "0.0.312",
|
|
16
17
|
"@teambit/harmony": "0.4.7",
|
|
17
|
-
"@teambit/bit-error": "0.0.404",
|
|
18
|
-
"@teambit/cli-table": "0.0.50",
|
|
19
|
-
"@teambit/builder": "1.0.714",
|
|
20
|
-
"@teambit/component": "1.0.714",
|
|
21
|
-
"@teambit/isolator": "1.0.714",
|
|
22
|
-
"@teambit/envs": "1.0.714",
|
|
23
18
|
"@teambit/logger": "0.0.1361",
|
|
24
|
-
"@teambit/
|
|
19
|
+
"@teambit/bit-error": "0.0.404",
|
|
25
20
|
"@teambit/cli": "0.0.1268",
|
|
26
|
-
"@teambit/
|
|
27
|
-
"@teambit/
|
|
28
|
-
"@teambit/
|
|
21
|
+
"@teambit/cli-table": "0.0.50",
|
|
22
|
+
"@teambit/builder": "1.0.716",
|
|
23
|
+
"@teambit/component": "1.0.716",
|
|
24
|
+
"@teambit/isolator": "1.0.716",
|
|
25
|
+
"@teambit/envs": "1.0.716",
|
|
26
|
+
"@teambit/aspect-loader": "1.0.716",
|
|
27
|
+
"@teambit/scope": "1.0.716",
|
|
28
|
+
"@teambit/watcher": "1.0.716",
|
|
29
|
+
"@teambit/workspace": "1.0.716"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/lodash": "4.14.165",
|
|
33
|
+
"@types/react-dev-utils": "9.0.15",
|
|
32
34
|
"@types/mocha": "9.1.0",
|
|
33
35
|
"@teambit/harmony.envs.core-aspect-env": "0.0.78"
|
|
34
36
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as compositions_0 from '/Users/davidfirst/Library/Caches/Bit/capsules/4ff44c81b/teambit.harmony_application@1.0.714/dist/application.composition.js';
|
|
2
|
-
import * as overview_0 from '/Users/davidfirst/Library/Caches/Bit/capsules/4ff44c81b/teambit.harmony_application@1.0.714/dist/application.docs.mdx';
|
|
3
|
-
|
|
4
|
-
export const compositions = [compositions_0];
|
|
5
|
-
export const overview = [overview_0];
|
|
6
|
-
|
|
7
|
-
export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
|