@teambit/application 0.0.208 → 0.0.212

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.
@@ -0,0 +1,34 @@
1
+ import { Command, CommandOptions } from '@teambit/cli';
2
+ // import { Logger } from '@teambit/logger';
3
+ import chalk from 'chalk';
4
+ import { CLITable } from '@teambit/cli-table';
5
+ import { ApplicationMain } from './application.main.runtime';
6
+
7
+ /**
8
+ * @deprecated use AppListCmd class
9
+ */
10
+ export class AppListCmdDeprecated implements Command {
11
+ name = 'app-list';
12
+ description = 'DEPRECATED. use "bit app list"';
13
+ alias = '';
14
+ group = 'apps';
15
+ options = [['j', 'json', 'return the component data in json format']] as CommandOptions;
16
+
17
+ constructor(private applicationAspect: ApplicationMain) {}
18
+
19
+ async report(args: [string], { json }: { json: boolean }) {
20
+ const apps = this.applicationAspect.listApps();
21
+ if (json) return JSON.stringify(apps, null, 2);
22
+ const deprecationStr = `this command is deprecated. please use "bit app list" instead\n`;
23
+ // eslint-disable-next-line no-console
24
+ console.log(chalk.red());
25
+ if (!apps.length) return chalk.yellow(`${deprecationStr}no apps found`);
26
+
27
+ const rows = apps.map((app) => {
28
+ return [app.name];
29
+ });
30
+
31
+ const table = new CLITable([], rows);
32
+ return deprecationStr + table.render();
33
+ }
34
+ }
@@ -0,0 +1,5 @@
1
+ export class AppNotFound extends Error {
2
+ constructor(appName: string) {
3
+ super(`app ${appName} was not found`);
4
+ }
5
+ }
@@ -0,0 +1 @@
1
+ export { AppNotFound } from './app-not-found';
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/application",
3
- "version": "0.0.208",
3
+ "version": "0.0.212",
4
4
  "homepage": "https://bit.dev/teambit/harmony/application",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "application",
9
- "version": "0.0.208"
9
+ "version": "0.0.212"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -16,14 +16,14 @@
16
16
  "ink": "3.0.8",
17
17
  "@babel/runtime": "7.12.18",
18
18
  "core-js": "^3.0.0",
19
- "@teambit/envs": "0.0.566",
20
- "@teambit/cli-table": "0.0.16",
21
- "@teambit/cli": "0.0.393",
22
- "@teambit/aspect-loader": "0.0.566",
23
- "@teambit/builder": "0.0.566",
24
- "@teambit/component": "0.0.566",
25
- "@teambit/logger": "0.0.478",
26
- "@teambit/isolator": "0.0.566"
19
+ "@teambit/envs": "0.0.570",
20
+ "@teambit/cli-table": "0.0.18",
21
+ "@teambit/cli": "0.0.395",
22
+ "@teambit/aspect-loader": "0.0.570",
23
+ "@teambit/builder": "0.0.570",
24
+ "@teambit/component": "0.0.570",
25
+ "@teambit/logger": "0.0.482",
26
+ "@teambit/isolator": "0.0.570"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/lodash": "4.14.165",
@@ -35,7 +35,7 @@
35
35
  "@types/node": "12.20.4"
36
36
  },
37
37
  "peerDependencies": {
38
- "@teambit/legacy": "1.0.179",
38
+ "@teambit/legacy": "1.0.181",
39
39
  "react-dom": "^16.8.0 || ^17.0.0",
40
40
  "react": "^16.8.0 || ^17.0.0"
41
41
  },
@@ -63,27 +63,12 @@
63
63
  "react": "-"
64
64
  },
65
65
  "peerDependencies": {
66
- "@teambit/legacy": "1.0.179",
66
+ "@teambit/legacy": "1.0.181",
67
67
  "react-dom": "^16.8.0 || ^17.0.0",
68
68
  "react": "^16.8.0 || ^17.0.0"
69
69
  }
70
70
  }
71
71
  },
72
- "files": [
73
- "dist",
74
- "!dist/tsconfig.tsbuildinfo",
75
- "**/*.md",
76
- "**/*.mdx",
77
- "**/*.js",
78
- "**/*.json",
79
- "**/*.sass",
80
- "**/*.scss",
81
- "**/*.less",
82
- "**/*.css",
83
- "**/*.css",
84
- "**/*.jpeg",
85
- "**/*.gif"
86
- ],
87
72
  "private": false,
88
73
  "engines": {
89
74
  "node": ">=12.22.0"
package/run.cmd.tsx ADDED
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import { Command, CommandOptions } from '@teambit/cli';
3
+ import { Text } from 'ink';
4
+ import { Logger } from '@teambit/logger';
5
+ import { ApplicationMain } from './application.main.runtime';
6
+
7
+ export class RunCmd implements Command {
8
+ name = 'run <app>';
9
+ description = 'run an application';
10
+ alias = 'c';
11
+ group = 'apps';
12
+ options = [
13
+ ['d', 'dev', 'start the application in dev mode.'],
14
+ ['v', 'verbose', 'showing verbose output for inspection and prints stack trace'],
15
+ ] as CommandOptions;
16
+
17
+ constructor(
18
+ /**
19
+ * access to the extension instance.
20
+ */
21
+ private application: ApplicationMain,
22
+
23
+ private logger: Logger
24
+ ) {}
25
+
26
+ async report(
27
+ [appName]: [string],
28
+ { dev }: { dev: boolean; port: string; rebuild: boolean; verbose: boolean; suppressBrowserLaunch: boolean }
29
+ ): Promise<string> {
30
+ this.logger.off();
31
+
32
+ const { port } = await this.application.runApp(appName, {
33
+ dev,
34
+ });
35
+
36
+ return `${appName} app is running on http://localhost:${port}`;
37
+ }
38
+
39
+ async render(
40
+ [appName]: [string],
41
+ { dev }: { dev: boolean; rebuild: boolean; verbose: boolean; suppressBrowserLaunch: boolean }
42
+ ): Promise<React.ReactElement> {
43
+ // remove wds logs until refactoring webpack to a worker through the Worker aspect.
44
+ const { port } = await this.application.runApp(appName, {
45
+ dev,
46
+ });
47
+
48
+ return (
49
+ <Text>
50
+ {appName} app is running on http://localhost:{port}
51
+ </Text>
52
+ );
53
+ // return <UIServerConsole appName={appName} futureUiServer={uiServer} />;
54
+ }
55
+ }
@@ -0,0 +1,29 @@
1
+ declare module '*.png' {
2
+ const value: any;
3
+ export = value;
4
+ }
5
+ declare module '*.svg' {
6
+ import type { FunctionComponent, SVGProps } from 'react';
7
+
8
+ export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
9
+ const src: string;
10
+ export default src;
11
+ }
12
+
13
+ // @TODO Gilad
14
+ declare module '*.jpg' {
15
+ const value: any;
16
+ export = value;
17
+ }
18
+ declare module '*.jpeg' {
19
+ const value: any;
20
+ export = value;
21
+ }
22
+ declare module '*.gif' {
23
+ const value: any;
24
+ export = value;
25
+ }
26
+ declare module '*.bmp' {
27
+ const value: any;
28
+ export = value;
29
+ }
@@ -0,0 +1,42 @@
1
+ declare module '*.module.css' {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
5
+ declare module '*.module.scss' {
6
+ const classes: { readonly [key: string]: string };
7
+ export default classes;
8
+ }
9
+ declare module '*.module.sass' {
10
+ const classes: { readonly [key: string]: string };
11
+ export default classes;
12
+ }
13
+
14
+ declare module '*.module.less' {
15
+ const classes: { readonly [key: string]: string };
16
+ export default classes;
17
+ }
18
+
19
+ declare module '*.less' {
20
+ const classes: { readonly [key: string]: string };
21
+ export default classes;
22
+ }
23
+
24
+ declare module '*.css' {
25
+ const classes: { readonly [key: string]: string };
26
+ export default classes;
27
+ }
28
+
29
+ declare module '*.sass' {
30
+ const classes: { readonly [key: string]: string };
31
+ export default classes;
32
+ }
33
+
34
+ declare module '*.scss' {
35
+ const classes: { readonly [key: string]: string };
36
+ export default classes;
37
+ }
38
+
39
+ declare module '*.mdx' {
40
+ const component: any;
41
+ export default component;
42
+ }