@teambit/application 1.0.717 → 1.0.719
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_application@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_application@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_application@1.0.719/dist/application.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_application@1.0.719/dist/application.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/dist/run.cmd.js
CHANGED
|
@@ -11,9 +11,9 @@ function _chalk() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = _interopRequireDefault(require("
|
|
16
|
-
|
|
14
|
+
function _open() {
|
|
15
|
+
const data = _interopRequireDefault(require("open"));
|
|
16
|
+
_open = function () {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
@@ -84,7 +84,7 @@ class RunCmd {
|
|
|
84
84
|
const url = `http://localhost:${port}`;
|
|
85
85
|
this.logger.console(`${appName} app is running on ${url}`);
|
|
86
86
|
if (!noBrowser && port) {
|
|
87
|
-
(0,
|
|
87
|
+
await (0, _open().default)(url);
|
|
88
88
|
}
|
|
89
89
|
} else if (port) {
|
|
90
90
|
// New API - also open browser when port is available
|
|
@@ -92,7 +92,7 @@ class RunCmd {
|
|
|
92
92
|
// this.logger.console(`${appName} app is running on ${url}`);
|
|
93
93
|
|
|
94
94
|
if (!noBrowser) {
|
|
95
|
-
(0,
|
|
95
|
+
await (0, _open().default)(url);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
package/dist/run.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_open","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","open","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 open from 'open';\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 await open(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 await open(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,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OAAO,CAAC,4DAA4D,CAAC;MACnF;IACF,CAAC,CAAC;EACJ;AACF;AAACqB,OAAA,CAAAvC,MAAA,GAAAA,MAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/application",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.719",
|
|
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.719"
|
|
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
|
-
"
|
|
15
|
+
"open": "8.4.2",
|
|
16
16
|
"@teambit/lane-id": "0.0.312",
|
|
17
17
|
"@teambit/harmony": "0.4.7",
|
|
18
18
|
"@teambit/logger": "0.0.1361",
|
|
19
19
|
"@teambit/bit-error": "0.0.404",
|
|
20
20
|
"@teambit/cli": "0.0.1268",
|
|
21
21
|
"@teambit/cli-table": "0.0.50",
|
|
22
|
-
"@teambit/builder": "1.0.
|
|
23
|
-
"@teambit/component": "1.0.
|
|
24
|
-
"@teambit/isolator": "1.0.
|
|
25
|
-
"@teambit/envs": "1.0.
|
|
26
|
-
"@teambit/aspect-loader": "1.0.
|
|
27
|
-
"@teambit/scope": "1.0.
|
|
28
|
-
"@teambit/watcher": "1.0.
|
|
29
|
-
"@teambit/workspace": "1.0.
|
|
22
|
+
"@teambit/builder": "1.0.719",
|
|
23
|
+
"@teambit/component": "1.0.719",
|
|
24
|
+
"@teambit/isolator": "1.0.719",
|
|
25
|
+
"@teambit/envs": "1.0.719",
|
|
26
|
+
"@teambit/aspect-loader": "1.0.719",
|
|
27
|
+
"@teambit/scope": "1.0.719",
|
|
28
|
+
"@teambit/watcher": "1.0.719",
|
|
29
|
+
"@teambit/workspace": "1.0.719"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/lodash": "4.14.165",
|
|
33
|
-
"@types/react-dev-utils": "9.0.15",
|
|
34
33
|
"@types/mocha": "9.1.0",
|
|
35
34
|
"@teambit/harmony.envs.core-aspect-env": "0.0.78"
|
|
36
35
|
},
|