@teambit/application 0.0.523 → 0.0.525
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/app-context.js +2 -8
- package/dist/app-context.js.map +1 -1
- package/dist/app-list.cmd.js +2 -17
- package/dist/app-list.cmd.js.map +1 -1
- package/dist/app-server.js +0 -4
- package/dist/app-server.js.map +1 -1
- package/dist/app-type.plugin.js +0 -15
- package/dist/app-type.plugin.js.map +1 -1
- package/dist/app.cmd.js +2 -22
- package/dist/app.cmd.js.map +1 -1
- package/dist/app.plugin.js +2 -11
- package/dist/app.plugin.js.map +1 -1
- package/dist/application.aspect.js +0 -5
- package/dist/application.aspect.js.map +1 -1
- package/dist/application.composition.js +0 -6
- package/dist/application.composition.js.map +1 -1
- package/dist/application.main.runtime.js +14 -116
- package/dist/application.main.runtime.js.map +1 -1
- package/dist/application.service.js +0 -9
- package/dist/application.service.js.map +1 -1
- package/dist/build.task.js +0 -32
- package/dist/build.task.js.map +1 -1
- package/dist/deploy.task.js +0 -28
- package/dist/deploy.task.js.map +1 -1
- package/dist/exceptions/app-no-ssr.js +0 -3
- package/dist/exceptions/app-no-ssr.js.map +1 -1
- package/dist/exceptions/app-not-found.js +0 -3
- package/dist/exceptions/app-not-found.js.map +1 -1
- package/dist/exceptions/index.js +0 -3
- package/dist/exceptions/index.js.map +1 -1
- package/dist/index.js +0 -24
- package/dist/index.js.map +1 -1
- package/dist/run.cmd.js +0 -23
- package/dist/run.cmd.js.map +1 -1
- package/package-tar/teambit-application-0.0.525.tgz +0 -0
- package/package.json +8 -8
- package/{preview-1666409808293.js → preview-1666582798766.js} +2 -2
- package/package-tar/teambit-application-0.0.523.tgz +0 -0
package/dist/build.task.js
CHANGED
|
@@ -1,83 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.flat-map.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.array.unscopables.flat-map.js");
|
|
8
|
-
|
|
9
6
|
require("core-js/modules/es.promise.js");
|
|
10
|
-
|
|
11
7
|
Object.defineProperty(exports, "__esModule", {
|
|
12
8
|
value: true
|
|
13
9
|
});
|
|
14
10
|
exports.BUILD_TASK = exports.AppsBuildTask = exports.ARTIFACTS_DIR_NAME = void 0;
|
|
15
|
-
|
|
16
11
|
function _defineProperty2() {
|
|
17
12
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
-
|
|
19
13
|
_defineProperty2 = function () {
|
|
20
14
|
return data;
|
|
21
15
|
};
|
|
22
|
-
|
|
23
16
|
return data;
|
|
24
17
|
}
|
|
25
|
-
|
|
26
18
|
function _path() {
|
|
27
19
|
const data = require("path");
|
|
28
|
-
|
|
29
20
|
_path = function () {
|
|
30
21
|
return data;
|
|
31
22
|
};
|
|
32
|
-
|
|
33
23
|
return data;
|
|
34
24
|
}
|
|
35
|
-
|
|
36
25
|
function _pMapSeries() {
|
|
37
26
|
const data = _interopRequireDefault(require("p-map-series"));
|
|
38
|
-
|
|
39
27
|
_pMapSeries = function () {
|
|
40
28
|
return data;
|
|
41
29
|
};
|
|
42
|
-
|
|
43
30
|
return data;
|
|
44
31
|
}
|
|
45
|
-
|
|
46
32
|
function _builder() {
|
|
47
33
|
const data = require("@teambit/builder");
|
|
48
|
-
|
|
49
34
|
_builder = function () {
|
|
50
35
|
return data;
|
|
51
36
|
};
|
|
52
|
-
|
|
53
37
|
return data;
|
|
54
38
|
}
|
|
55
|
-
|
|
56
39
|
function _component() {
|
|
57
40
|
const data = require("@teambit/component");
|
|
58
|
-
|
|
59
41
|
_component = function () {
|
|
60
42
|
return data;
|
|
61
43
|
};
|
|
62
|
-
|
|
63
44
|
return data;
|
|
64
45
|
}
|
|
65
|
-
|
|
66
46
|
function _application() {
|
|
67
47
|
const data = require("./application.aspect");
|
|
68
|
-
|
|
69
48
|
_application = function () {
|
|
70
49
|
return data;
|
|
71
50
|
};
|
|
72
|
-
|
|
73
51
|
return data;
|
|
74
52
|
}
|
|
75
|
-
|
|
76
53
|
const BUILD_TASK = 'build_application';
|
|
77
54
|
exports.BUILD_TASK = BUILD_TASK;
|
|
78
55
|
const ARTIFACTS_DIR_NAME = 'apps';
|
|
79
56
|
exports.ARTIFACTS_DIR_NAME = ARTIFACTS_DIR_NAME;
|
|
80
|
-
|
|
81
57
|
class AppsBuildTask {
|
|
82
58
|
constructor(application, opt = {
|
|
83
59
|
deploy: true
|
|
@@ -88,7 +64,6 @@ class AppsBuildTask {
|
|
|
88
64
|
(0, _defineProperty2().default)(this, "aspectId", _application().ApplicationAspect.id);
|
|
89
65
|
(0, _defineProperty2().default)(this, "location", 'end');
|
|
90
66
|
}
|
|
91
|
-
|
|
92
67
|
async execute(context) {
|
|
93
68
|
const apps = this.application.listApps();
|
|
94
69
|
const {
|
|
@@ -117,7 +92,6 @@ class AppsBuildTask {
|
|
|
117
92
|
component: capsule.component,
|
|
118
93
|
errors: deployContext.errors,
|
|
119
94
|
warnings: deployContext.warnings,
|
|
120
|
-
|
|
121
95
|
/**
|
|
122
96
|
* @guysaar223
|
|
123
97
|
* @ram8
|
|
@@ -134,21 +108,17 @@ class AppsBuildTask {
|
|
|
134
108
|
const artifacts = componentsResults.flatMap(res => {
|
|
135
109
|
return res === null || res === void 0 ? void 0 : res.artifacts;
|
|
136
110
|
}).filter(a => !!a);
|
|
137
|
-
|
|
138
111
|
const _componentsResults = componentsResults.map(res => {
|
|
139
112
|
return res === null || res === void 0 ? void 0 : res.componentResult;
|
|
140
113
|
}).filter(a => !!a);
|
|
141
|
-
|
|
142
114
|
return {
|
|
143
115
|
artifacts,
|
|
144
116
|
componentsResults: _componentsResults
|
|
145
117
|
};
|
|
146
118
|
}
|
|
147
|
-
|
|
148
119
|
getArtifactDirectory() {
|
|
149
120
|
return (0, _path().join)(_builder().CAPSULE_ARTIFACTS_DIR, ARTIFACTS_DIR_NAME);
|
|
150
121
|
}
|
|
151
|
-
|
|
152
122
|
getDefaultArtifactDef(nameSuffix) {
|
|
153
123
|
return [{
|
|
154
124
|
name: `app-build-${nameSuffix}`,
|
|
@@ -156,9 +126,7 @@ class AppsBuildTask {
|
|
|
156
126
|
rootDir: this.getArtifactDirectory()
|
|
157
127
|
}];
|
|
158
128
|
}
|
|
159
|
-
|
|
160
129
|
}
|
|
161
|
-
|
|
162
130
|
exports.AppsBuildTask = AppsBuildTask;
|
|
163
131
|
|
|
164
132
|
//# sourceMappingURL=build.task.js.map
|
package/dist/build.task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BUILD_TASK","ARTIFACTS_DIR_NAME","AppsBuildTask","constructor","application","opt","deploy","ApplicationAspect","id","execute","context","apps","listApps","capsuleNetwork","componentsResults","mapSeries","app","aspectId","getAppAspect","name","undefined","capsule","seedersCapsules","getCapsuleIgnoreVersion","ComponentID","fromString","build","component","appDeployContext","Object","assign","appComponent","artifactsDir","getArtifactDirectory","deployContext","defaultArtifacts","getDefaultArtifactDef","applicationType","artifacts","concat","componentResult","errors","warnings","_metadata","flatMap","res","filter","a","_componentsResults","map","join","CAPSULE_ARTIFACTS_DIR","nameSuffix","globPatterns","rootDir"],"sources":["build.task.ts"],"sourcesContent":["import { join } from 'path';\nimport mapSeries from 'p-map-series';\nimport {\n BuildTask,\n BuiltTaskResult,\n BuildContext,\n ComponentResult,\n ArtifactDefinition,\n CAPSULE_ARTIFACTS_DIR,\n} from '@teambit/builder';\nimport { ComponentID } from '@teambit/component';\nimport { ApplicationAspect } from './application.aspect';\nimport { ApplicationMain } from './application.main.runtime';\nimport { AppBuildContext } from './app-build-context';\n\nexport const BUILD_TASK = 'build_application';\nexport const ARTIFACTS_DIR_NAME = 'apps';\n\nexport type AppsResults = {\n componentResult: ComponentResult;\n artifacts?: ArtifactDefinition[];\n};\n\nexport type Options = {\n deploy: boolean;\n};\nexport class AppsBuildTask implements BuildTask {\n name = BUILD_TASK;\n aspectId = ApplicationAspect.id;\n readonly location = 'end';\n constructor(private application: ApplicationMain, private opt: Options = { deploy: true }) {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const apps = this.application.listApps();\n const { capsuleNetwork } = context;\n const componentsResults = await mapSeries(apps, async (app): Promise<AppsResults | undefined> => {\n const aspectId = this.application.getAppAspect(app.name);\n if (!aspectId) return undefined;\n const capsule = capsuleNetwork.seedersCapsules.getCapsuleIgnoreVersion(ComponentID.fromString(aspectId));\n if (!capsule || !app.build) return undefined;\n const { component } = capsule;\n const appDeployContext: AppBuildContext = Object.assign(context, {\n capsule,\n appComponent: component,\n name: app.name,\n artifactsDir: this.getArtifactDirectory(),\n });\n const deployContext = await app.build(appDeployContext);\n const defaultArtifacts: ArtifactDefinition[] = this.getDefaultArtifactDef(app.applicationType || app.name);\n const artifacts = defaultArtifacts.concat(deployContext.artifacts || []);\n\n return {\n artifacts,\n componentResult: {\n component: capsule.component,\n errors: deployContext.errors,\n warnings: deployContext.warnings,\n /**\n * @guysaar223\n * @ram8\n * TODO: we need to think how to pass private metadata between build pipes, maybe create shared context\n * or create new deploy context on builder\n */\n // @ts-ignore\n _metadata: { deployContext },\n },\n };\n });\n\n const artifacts = componentsResults\n .flatMap((res) => {\n return res?.artifacts;\n })\n .filter((a) => !!a) as ArtifactDefinition[];\n const _componentsResults = componentsResults\n .map((res) => {\n return res?.componentResult;\n })\n .filter((a) => !!a) as ComponentResult[];\n return {\n artifacts,\n componentsResults: _componentsResults,\n };\n }\n\n private getArtifactDirectory() {\n return join(CAPSULE_ARTIFACTS_DIR, ARTIFACTS_DIR_NAME);\n }\n\n private getDefaultArtifactDef(nameSuffix: string): ArtifactDefinition[] {\n return [\n {\n name: `app-build-${nameSuffix}`,\n globPatterns: ['**'],\n rootDir: this.getArtifactDirectory(),\n },\n ];\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["BUILD_TASK","ARTIFACTS_DIR_NAME","AppsBuildTask","constructor","application","opt","deploy","ApplicationAspect","id","execute","context","apps","listApps","capsuleNetwork","componentsResults","mapSeries","app","aspectId","getAppAspect","name","undefined","capsule","seedersCapsules","getCapsuleIgnoreVersion","ComponentID","fromString","build","component","appDeployContext","Object","assign","appComponent","artifactsDir","getArtifactDirectory","deployContext","defaultArtifacts","getDefaultArtifactDef","applicationType","artifacts","concat","componentResult","errors","warnings","_metadata","flatMap","res","filter","a","_componentsResults","map","join","CAPSULE_ARTIFACTS_DIR","nameSuffix","globPatterns","rootDir"],"sources":["build.task.ts"],"sourcesContent":["import { join } from 'path';\nimport mapSeries from 'p-map-series';\nimport {\n BuildTask,\n BuiltTaskResult,\n BuildContext,\n ComponentResult,\n ArtifactDefinition,\n CAPSULE_ARTIFACTS_DIR,\n} from '@teambit/builder';\nimport { ComponentID } from '@teambit/component';\nimport { ApplicationAspect } from './application.aspect';\nimport { ApplicationMain } from './application.main.runtime';\nimport { AppBuildContext } from './app-build-context';\n\nexport const BUILD_TASK = 'build_application';\nexport const ARTIFACTS_DIR_NAME = 'apps';\n\nexport type AppsResults = {\n componentResult: ComponentResult;\n artifacts?: ArtifactDefinition[];\n};\n\nexport type Options = {\n deploy: boolean;\n};\nexport class AppsBuildTask implements BuildTask {\n name = BUILD_TASK;\n aspectId = ApplicationAspect.id;\n readonly location = 'end';\n constructor(private application: ApplicationMain, private opt: Options = { deploy: true }) {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const apps = this.application.listApps();\n const { capsuleNetwork } = context;\n const componentsResults = await mapSeries(apps, async (app): Promise<AppsResults | undefined> => {\n const aspectId = this.application.getAppAspect(app.name);\n if (!aspectId) return undefined;\n const capsule = capsuleNetwork.seedersCapsules.getCapsuleIgnoreVersion(ComponentID.fromString(aspectId));\n if (!capsule || !app.build) return undefined;\n const { component } = capsule;\n const appDeployContext: AppBuildContext = Object.assign(context, {\n capsule,\n appComponent: component,\n name: app.name,\n artifactsDir: this.getArtifactDirectory(),\n });\n const deployContext = await app.build(appDeployContext);\n const defaultArtifacts: ArtifactDefinition[] = this.getDefaultArtifactDef(app.applicationType || app.name);\n const artifacts = defaultArtifacts.concat(deployContext.artifacts || []);\n\n return {\n artifacts,\n componentResult: {\n component: capsule.component,\n errors: deployContext.errors,\n warnings: deployContext.warnings,\n /**\n * @guysaar223\n * @ram8\n * TODO: we need to think how to pass private metadata between build pipes, maybe create shared context\n * or create new deploy context on builder\n */\n // @ts-ignore\n _metadata: { deployContext },\n },\n };\n });\n\n const artifacts = componentsResults\n .flatMap((res) => {\n return res?.artifacts;\n })\n .filter((a) => !!a) as ArtifactDefinition[];\n const _componentsResults = componentsResults\n .map((res) => {\n return res?.componentResult;\n })\n .filter((a) => !!a) as ComponentResult[];\n return {\n artifacts,\n componentsResults: _componentsResults,\n };\n }\n\n private getArtifactDirectory() {\n return join(CAPSULE_ARTIFACTS_DIR, ARTIFACTS_DIR_NAME);\n }\n\n private getDefaultArtifactDef(nameSuffix: string): ArtifactDefinition[] {\n return [\n {\n name: `app-build-${nameSuffix}`,\n globPatterns: ['**'],\n rootDir: this.getArtifactDirectory(),\n },\n ];\n }\n}\n"],"mappings":"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"}
|
package/dist/deploy.task.js
CHANGED
|
@@ -1,67 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.promise.js");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.DeployTask = exports.DEPLOY_TASK = void 0;
|
|
11
|
-
|
|
12
9
|
function _defineProperty2() {
|
|
13
10
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
|
|
15
11
|
_defineProperty2 = function () {
|
|
16
12
|
return data;
|
|
17
13
|
};
|
|
18
|
-
|
|
19
14
|
return data;
|
|
20
15
|
}
|
|
21
|
-
|
|
22
16
|
function _pMapSeries() {
|
|
23
17
|
const data = _interopRequireDefault(require("p-map-series"));
|
|
24
|
-
|
|
25
18
|
_pMapSeries = function () {
|
|
26
19
|
return data;
|
|
27
20
|
};
|
|
28
|
-
|
|
29
21
|
return data;
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
function _component() {
|
|
33
24
|
const data = require("@teambit/component");
|
|
34
|
-
|
|
35
25
|
_component = function () {
|
|
36
26
|
return data;
|
|
37
27
|
};
|
|
38
|
-
|
|
39
28
|
return data;
|
|
40
29
|
}
|
|
41
|
-
|
|
42
30
|
function _application() {
|
|
43
31
|
const data = require("./application.aspect");
|
|
44
|
-
|
|
45
32
|
_application = function () {
|
|
46
33
|
return data;
|
|
47
34
|
};
|
|
48
|
-
|
|
49
35
|
return data;
|
|
50
36
|
}
|
|
51
|
-
|
|
52
37
|
function _build() {
|
|
53
38
|
const data = require("./build.task");
|
|
54
|
-
|
|
55
39
|
_build = function () {
|
|
56
40
|
return data;
|
|
57
41
|
};
|
|
58
|
-
|
|
59
42
|
return data;
|
|
60
43
|
}
|
|
61
|
-
|
|
62
44
|
const DEPLOY_TASK = 'deploy_application';
|
|
63
45
|
exports.DEPLOY_TASK = DEPLOY_TASK;
|
|
64
|
-
|
|
65
46
|
class DeployTask {
|
|
66
47
|
constructor(application, builder) {
|
|
67
48
|
this.application = application;
|
|
@@ -70,12 +51,10 @@ class DeployTask {
|
|
|
70
51
|
(0, _defineProperty2().default)(this, "aspectId", _application().ApplicationAspect.id);
|
|
71
52
|
(0, _defineProperty2().default)(this, "location", 'end');
|
|
72
53
|
}
|
|
73
|
-
|
|
74
54
|
async execute(context) {
|
|
75
55
|
const apps = this.application.listApps();
|
|
76
56
|
const componentsResults = await (0, _pMapSeries().default)(apps, async app => {
|
|
77
57
|
var _componentResults$_me;
|
|
78
|
-
|
|
79
58
|
const aspectId = this.application.getAppAspect(app.name);
|
|
80
59
|
if (!aspectId) return undefined;
|
|
81
60
|
const capsule = context.capsuleNetwork.seedersCapsules.getCapsuleIgnoreVersion(_component().ComponentID.fromString(aspectId));
|
|
@@ -92,9 +71,7 @@ class DeployTask {
|
|
|
92
71
|
* or create new deploy context on builder
|
|
93
72
|
*/
|
|
94
73
|
// @ts-ignore
|
|
95
|
-
|
|
96
74
|
const _metadata = (componentResults === null || componentResults === void 0 ? void 0 : (_componentResults$_me = componentResults._metadata) === null || _componentResults$_me === void 0 ? void 0 : _componentResults$_me.deployContext) || {};
|
|
97
|
-
|
|
98
75
|
const appDeployContext = Object.assign(context, _metadata, {
|
|
99
76
|
capsule,
|
|
100
77
|
appComponent: capsule.component
|
|
@@ -107,25 +84,20 @@ class DeployTask {
|
|
|
107
84
|
}
|
|
108
85
|
};
|
|
109
86
|
});
|
|
110
|
-
|
|
111
87
|
const _componentsResults = componentsResults.map(res => {
|
|
112
88
|
return res === null || res === void 0 ? void 0 : res.componentResult;
|
|
113
89
|
}).filter(a => !!a);
|
|
114
|
-
|
|
115
90
|
return {
|
|
116
91
|
componentsResults: _componentsResults
|
|
117
92
|
};
|
|
118
93
|
}
|
|
119
|
-
|
|
120
94
|
getBuildTask(taskResults, runtime) {
|
|
121
95
|
return taskResults.find(({
|
|
122
96
|
task,
|
|
123
97
|
env
|
|
124
98
|
}) => task.aspectId === _application().ApplicationAspect.id && task.name === _build().BUILD_TASK && env.id === runtime);
|
|
125
99
|
}
|
|
126
|
-
|
|
127
100
|
}
|
|
128
|
-
|
|
129
101
|
exports.DeployTask = DeployTask;
|
|
130
102
|
|
|
131
103
|
//# sourceMappingURL=deploy.task.js.map
|
package/dist/deploy.task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEPLOY_TASK","DeployTask","constructor","application","builder","ApplicationAspect","id","execute","context","apps","listApps","componentsResults","mapSeries","app","aspectId","getAppAspect","name","undefined","capsule","capsuleNetwork","seedersCapsules","getCapsuleIgnoreVersion","ComponentID","fromString","component","buildTask","getBuildTask","previousTasksResults","envRuntime","componentResults","find","res","isEqual","ignoreVersion","_metadata","deployContext","appDeployContext","Object","assign","appComponent","deploy","componentResult","_componentsResults","map","filter","a","taskResults","runtime","task","env","BUILD_TASK"],"sources":["deploy.task.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { BuilderMain, BuildTask, BuildContext, ComponentResult, TaskResults } from '@teambit/builder';\nimport { ComponentID } from '@teambit/component';\nimport { ApplicationAspect } from './application.aspect';\nimport { ApplicationMain } from './application.main.runtime';\nimport { BUILD_TASK } from './build.task';\nimport { AppDeployContext } from './app-deploy-context';\n\nexport const DEPLOY_TASK = 'deploy_application';\n\nexport class DeployTask implements BuildTask {\n name = DEPLOY_TASK;\n aspectId = ApplicationAspect.id;\n readonly location = 'end';\n constructor(private application: ApplicationMain, private builder: BuilderMain) {}\n\n async execute(context: BuildContext): Promise<any> {\n const apps = this.application.listApps();\n const componentsResults = await mapSeries(apps, async (app): Promise<any> => {\n const aspectId = this.application.getAppAspect(app.name);\n if (!aspectId) return undefined;\n const capsule = context.capsuleNetwork.seedersCapsules.getCapsuleIgnoreVersion(ComponentID.fromString(aspectId));\n if (!capsule || !capsule?.component) return undefined;\n const buildTask = this.getBuildTask(context.previousTasksResults, context.envRuntime.id);\n if (!buildTask) return undefined;\n const componentResults = buildTask.componentsResults.find((res) =>\n res.component.id.isEqual(capsule.component.id, { ignoreVersion: true })\n );\n /**\n * @guysaar223\n * @ram8\n * TODO: we need to think how to pass private metadata between build pipes, maybe create shared context\n * or create new deploy context on builder\n */\n // @ts-ignore\n const _metadata = componentResults?._metadata?.deployContext || {};\n const appDeployContext: AppDeployContext = Object.assign(context, _metadata, {\n capsule,\n appComponent: capsule.component,\n });\n if (!app.deploy) return undefined;\n await app.deploy(appDeployContext);\n\n return {\n componentResult: { component: capsule.component },\n };\n });\n\n const _componentsResults = componentsResults\n .map((res) => {\n return res?.componentResult;\n })\n .filter((a) => !!a) as ComponentResult[];\n\n return {\n componentsResults: _componentsResults,\n };\n }\n\n private getBuildTask(taskResults: TaskResults[], runtime: string) {\n return taskResults.find(\n ({ task, env }) => task.aspectId === ApplicationAspect.id && task.name === BUILD_TASK && env.id === runtime\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["DEPLOY_TASK","DeployTask","constructor","application","builder","ApplicationAspect","id","execute","context","apps","listApps","componentsResults","mapSeries","app","aspectId","getAppAspect","name","undefined","capsule","capsuleNetwork","seedersCapsules","getCapsuleIgnoreVersion","ComponentID","fromString","component","buildTask","getBuildTask","previousTasksResults","envRuntime","componentResults","find","res","isEqual","ignoreVersion","_metadata","deployContext","appDeployContext","Object","assign","appComponent","deploy","componentResult","_componentsResults","map","filter","a","taskResults","runtime","task","env","BUILD_TASK"],"sources":["deploy.task.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { BuilderMain, BuildTask, BuildContext, ComponentResult, TaskResults } from '@teambit/builder';\nimport { ComponentID } from '@teambit/component';\nimport { ApplicationAspect } from './application.aspect';\nimport { ApplicationMain } from './application.main.runtime';\nimport { BUILD_TASK } from './build.task';\nimport { AppDeployContext } from './app-deploy-context';\n\nexport const DEPLOY_TASK = 'deploy_application';\n\nexport class DeployTask implements BuildTask {\n name = DEPLOY_TASK;\n aspectId = ApplicationAspect.id;\n readonly location = 'end';\n constructor(private application: ApplicationMain, private builder: BuilderMain) {}\n\n async execute(context: BuildContext): Promise<any> {\n const apps = this.application.listApps();\n const componentsResults = await mapSeries(apps, async (app): Promise<any> => {\n const aspectId = this.application.getAppAspect(app.name);\n if (!aspectId) return undefined;\n const capsule = context.capsuleNetwork.seedersCapsules.getCapsuleIgnoreVersion(ComponentID.fromString(aspectId));\n if (!capsule || !capsule?.component) return undefined;\n const buildTask = this.getBuildTask(context.previousTasksResults, context.envRuntime.id);\n if (!buildTask) return undefined;\n const componentResults = buildTask.componentsResults.find((res) =>\n res.component.id.isEqual(capsule.component.id, { ignoreVersion: true })\n );\n /**\n * @guysaar223\n * @ram8\n * TODO: we need to think how to pass private metadata between build pipes, maybe create shared context\n * or create new deploy context on builder\n */\n // @ts-ignore\n const _metadata = componentResults?._metadata?.deployContext || {};\n const appDeployContext: AppDeployContext = Object.assign(context, _metadata, {\n capsule,\n appComponent: capsule.component,\n });\n if (!app.deploy) return undefined;\n await app.deploy(appDeployContext);\n\n return {\n componentResult: { component: capsule.component },\n };\n });\n\n const _componentsResults = componentsResults\n .map((res) => {\n return res?.componentResult;\n })\n .filter((a) => !!a) as ComponentResult[];\n\n return {\n componentsResults: _componentsResults,\n };\n }\n\n private getBuildTask(taskResults: TaskResults[], runtime: string) {\n return taskResults.find(\n ({ task, env }) => task.aspectId === ApplicationAspect.id && task.name === BUILD_TASK && env.id === runtime\n );\n }\n}\n"],"mappings":"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"}
|
|
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.AppNoSsr = void 0;
|
|
7
|
-
|
|
8
7
|
class AppNoSsr extends Error {
|
|
9
8
|
constructor(appName) {
|
|
10
9
|
super(`app "${appName}" does not support serverside execution`);
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
exports.AppNoSsr = AppNoSsr;
|
|
16
13
|
|
|
17
14
|
//# sourceMappingURL=app-no-ssr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AppNoSsr","Error","constructor","appName"],"sources":["app-no-ssr.ts"],"sourcesContent":["export class AppNoSsr extends Error {\n constructor(appName: string) {\n super(`app \"${appName}\" does not support serverside execution`);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["AppNoSsr","Error","constructor","appName"],"sources":["app-no-ssr.ts"],"sourcesContent":["export class AppNoSsr extends Error {\n constructor(appName: string) {\n super(`app \"${appName}\" does not support serverside execution`);\n }\n}\n"],"mappings":";;;;;;AAAO,MAAMA,QAAQ,SAASC,KAAK,CAAC;EAClCC,WAAW,CAACC,OAAe,EAAE;IAC3B,KAAK,CAAE,QAAOA,OAAQ,yCAAwC,CAAC;EACjE;AACF;AAAC"}
|
|
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.AppNotFound = void 0;
|
|
7
|
-
|
|
8
7
|
class AppNotFound extends Error {
|
|
9
8
|
constructor(appName) {
|
|
10
9
|
super(`app "${appName}" was not found`);
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
exports.AppNotFound = AppNotFound;
|
|
16
13
|
|
|
17
14
|
//# sourceMappingURL=app-not-found.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AppNotFound","Error","constructor","appName"],"sources":["app-not-found.ts"],"sourcesContent":["export class AppNotFound extends Error {\n constructor(appName: string) {\n super(`app \"${appName}\" was not found`);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["AppNotFound","Error","constructor","appName"],"sources":["app-not-found.ts"],"sourcesContent":["export class AppNotFound extends Error {\n constructor(appName: string) {\n super(`app \"${appName}\" was not found`);\n }\n}\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,SAASC,KAAK,CAAC;EACrCC,WAAW,CAACC,OAAe,EAAE;IAC3B,KAAK,CAAE,QAAOA,OAAQ,iBAAgB,CAAC;EACzC;AACF;AAAC"}
|
package/dist/exceptions/index.js
CHANGED
|
@@ -9,14 +9,11 @@ Object.defineProperty(exports, "AppNotFound", {
|
|
|
9
9
|
return _appNotFound().AppNotFound;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
function _appNotFound() {
|
|
14
13
|
const data = require("./app-not-found");
|
|
15
|
-
|
|
16
14
|
_appNotFound = function () {
|
|
17
15
|
return data;
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
return data;
|
|
21
18
|
}
|
|
22
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { AppNotFound } from './app-not-found';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { AppNotFound } from './app-not-found';\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
package/dist/index.js
CHANGED
|
@@ -51,84 +51,60 @@ Object.defineProperty(exports, "DeploymentProvider", {
|
|
|
51
51
|
return _deploymentProvider().DeploymentProvider;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
|
|
55
54
|
function _application() {
|
|
56
55
|
const data = require("./application.aspect");
|
|
57
|
-
|
|
58
56
|
_application = function () {
|
|
59
57
|
return data;
|
|
60
58
|
};
|
|
61
|
-
|
|
62
59
|
return data;
|
|
63
60
|
}
|
|
64
|
-
|
|
65
61
|
function _appContext() {
|
|
66
62
|
const data = require("./app-context");
|
|
67
|
-
|
|
68
63
|
_appContext = function () {
|
|
69
64
|
return data;
|
|
70
65
|
};
|
|
71
|
-
|
|
72
66
|
return data;
|
|
73
67
|
}
|
|
74
|
-
|
|
75
68
|
function _deploymentProvider() {
|
|
76
69
|
const data = require("./deployment-provider");
|
|
77
|
-
|
|
78
70
|
_deploymentProvider = function () {
|
|
79
71
|
return data;
|
|
80
72
|
};
|
|
81
|
-
|
|
82
73
|
return data;
|
|
83
74
|
}
|
|
84
|
-
|
|
85
75
|
function _applicationType() {
|
|
86
76
|
const data = require("./application-type");
|
|
87
|
-
|
|
88
77
|
_applicationType = function () {
|
|
89
78
|
return data;
|
|
90
79
|
};
|
|
91
|
-
|
|
92
80
|
return data;
|
|
93
81
|
}
|
|
94
|
-
|
|
95
82
|
function _appDeployContext() {
|
|
96
83
|
const data = require("./app-deploy-context");
|
|
97
|
-
|
|
98
84
|
_appDeployContext = function () {
|
|
99
85
|
return data;
|
|
100
86
|
};
|
|
101
|
-
|
|
102
87
|
return data;
|
|
103
88
|
}
|
|
104
|
-
|
|
105
89
|
function _appBuildContext() {
|
|
106
90
|
const data = require("./app-build-context");
|
|
107
|
-
|
|
108
91
|
_appBuildContext = function () {
|
|
109
92
|
return data;
|
|
110
93
|
};
|
|
111
|
-
|
|
112
94
|
return data;
|
|
113
95
|
}
|
|
114
|
-
|
|
115
96
|
function _appBuildResult() {
|
|
116
97
|
const data = require("./app-build-result");
|
|
117
|
-
|
|
118
98
|
_appBuildResult = function () {
|
|
119
99
|
return data;
|
|
120
100
|
};
|
|
121
|
-
|
|
122
101
|
return data;
|
|
123
102
|
}
|
|
124
|
-
|
|
125
103
|
function _build() {
|
|
126
104
|
const data = require("./build.task");
|
|
127
|
-
|
|
128
105
|
_build = function () {
|
|
129
106
|
return data;
|
|
130
107
|
};
|
|
131
|
-
|
|
132
108
|
return data;
|
|
133
109
|
}
|
|
134
110
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ApplicationAspect } from './application.aspect';\nexport type { ApplicationMain } from './application.main.runtime';\nexport type { Application, DeployFn, AppResult } from './application';\nexport { AppContext } from './app-context';\nexport { DeploymentProvider } from './deployment-provider';\nexport { ApplicationType } from './application-type';\nexport { AppDeployContext } from './app-deploy-context';\nexport { AppBuildContext } from './app-build-context';\nexport { AppBuildResult } from './app-build-result';\nexport { ARTIFACTS_DIR_NAME as APPS_ARTIFACTS_DIR_NAME } from './build.task';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ApplicationAspect } from './application.aspect';\nexport type { ApplicationMain } from './application.main.runtime';\nexport type { Application, DeployFn, AppResult } from './application';\nexport { AppContext } from './app-context';\nexport { DeploymentProvider } from './deployment-provider';\nexport { ApplicationType } from './application-type';\nexport { AppDeployContext } from './app-deploy-context';\nexport { AppBuildContext } from './app-build-context';\nexport { AppBuildResult } from './app-build-result';\nexport { ARTIFACTS_DIR_NAME as APPS_ARTIFACTS_DIR_NAME } from './build.task';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
package/dist/run.cmd.js
CHANGED
|
@@ -1,56 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.promise.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.RunCmd = void 0;
|
|
13
|
-
|
|
14
10
|
function _defineProperty2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
|
|
17
12
|
_defineProperty2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _react() {
|
|
25
18
|
const data = _interopRequireDefault(require("react"));
|
|
26
|
-
|
|
27
19
|
_react = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _pluralize() {
|
|
35
25
|
const data = _interopRequireDefault(require("pluralize"));
|
|
36
|
-
|
|
37
26
|
_pluralize = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
function _ink() {
|
|
45
32
|
const data = require("ink");
|
|
46
|
-
|
|
47
33
|
_ink = function () {
|
|
48
34
|
return data;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
36
|
return data;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
class RunCmd {
|
|
55
39
|
constructor(
|
|
56
40
|
/**
|
|
@@ -69,7 +53,6 @@ class RunCmd {
|
|
|
69
53
|
(0, _defineProperty2().default)(this, "group", 'apps');
|
|
70
54
|
(0, _defineProperty2().default)(this, "options", [['d', 'dev', 'start the application in dev mode.'], ['v', 'verbose', 'showing verbose output for inspection and prints stack trace'], ['', 'skip-watch', 'avoid running the watch process that compiles components in the background'], ['', 'ssr', 'run app in server side rendering mode.']]);
|
|
71
55
|
}
|
|
72
|
-
|
|
73
56
|
async render([appName], {
|
|
74
57
|
dev,
|
|
75
58
|
skipWatch,
|
|
@@ -84,7 +67,6 @@ class RunCmd {
|
|
|
84
67
|
watch: !skipWatch,
|
|
85
68
|
ssr
|
|
86
69
|
});
|
|
87
|
-
|
|
88
70
|
if (errors) {
|
|
89
71
|
return {
|
|
90
72
|
code: 1,
|
|
@@ -93,18 +75,13 @@ class RunCmd {
|
|
|
93
75
|
})
|
|
94
76
|
};
|
|
95
77
|
}
|
|
96
|
-
|
|
97
78
|
if (port) {
|
|
98
79
|
return /*#__PURE__*/_react().default.createElement(_ink().Text, null, appName, " app is running on http://localhost:", port);
|
|
99
80
|
}
|
|
100
|
-
|
|
101
81
|
return /*#__PURE__*/_react().default.createElement(_ink().Text, null, appName, " app is running");
|
|
102
82
|
}
|
|
103
|
-
|
|
104
83
|
}
|
|
105
|
-
|
|
106
84
|
exports.RunCmd = RunCmd;
|
|
107
|
-
|
|
108
85
|
function ShowErrors({
|
|
109
86
|
errors
|
|
110
87
|
}) {
|
package/dist/run.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RunCmd","constructor","application","logger","name","description","render","appName","dev","skipWatch","ssr","port","errors","runApp","watch","code","data","ShowErrors","pluralize","length","map","x","idx","toString"],"sources":["run.cmd.tsx"],"sourcesContent":["import React from 'react';\nimport pluralize from 'pluralize';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Newline, Text } from 'ink';\nimport { Logger } from '@teambit/logger';\nimport type { RenderResult } from '@teambit/legacy/dist/cli/command';\nimport { ApplicationMain } from './application.main.runtime';\n\ntype RunOptions = {\n dev: boolean;\n verbose: boolean;\n skipWatch: boolean;\n ssr: boolean;\n};\n\nexport class RunCmd implements Command {\n name = 'run <app-name>';\n description = \"run an app (independent of bit's dev server)\";\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 = 'apps';\n options = [\n ['d', 'dev', 'start the application in dev mode.'],\n ['v', 'verbose', 'showing verbose output for inspection and prints stack trace'],\n ['', 'skip-watch', 'avoid running the watch process that compiles components in the background'],\n ['', 'ssr', 'run app in server side rendering mode.'],\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 render([appName]: [string], { dev, skipWatch, ssr }: RunOptions): Promise<React.ReactElement | RenderResult> {\n // remove wds logs until refactoring webpack to a worker through the Worker aspect.\n const { port, errors } = await this.application.runApp(appName, {\n dev,\n watch: !skipWatch,\n ssr,\n });\n\n if (errors) {\n return {\n code: 1,\n data: <ShowErrors errors={errors} />,\n };\n }\n\n if (port) {\n return (\n <Text>\n {appName} app is running on http://localhost:{port}\n </Text>\n );\n }\n return <Text>{appName} app is running</Text>;\n }\n}\n\nfunction ShowErrors({ errors }: { errors: Error[] }) {\n return (\n <>\n <Newline />\n <Text underline>Fatal {pluralize('error', errors.length)}:</Text>\n {errors.map((x, idx) => (\n <Text key={idx}>{x.toString()}</Text>\n ))}\n </>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["RunCmd","constructor","application","logger","name","description","render","appName","dev","skipWatch","ssr","port","errors","runApp","watch","code","data","ShowErrors","pluralize","length","map","x","idx","toString"],"sources":["run.cmd.tsx"],"sourcesContent":["import React from 'react';\nimport pluralize from 'pluralize';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Newline, Text } from 'ink';\nimport { Logger } from '@teambit/logger';\nimport type { RenderResult } from '@teambit/legacy/dist/cli/command';\nimport { ApplicationMain } from './application.main.runtime';\n\ntype RunOptions = {\n dev: boolean;\n verbose: boolean;\n skipWatch: boolean;\n ssr: boolean;\n};\n\nexport class RunCmd implements Command {\n name = 'run <app-name>';\n description = \"run an app (independent of bit's dev server)\";\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 = 'apps';\n options = [\n ['d', 'dev', 'start the application in dev mode.'],\n ['v', 'verbose', 'showing verbose output for inspection and prints stack trace'],\n ['', 'skip-watch', 'avoid running the watch process that compiles components in the background'],\n ['', 'ssr', 'run app in server side rendering mode.'],\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 render([appName]: [string], { dev, skipWatch, ssr }: RunOptions): Promise<React.ReactElement | RenderResult> {\n // remove wds logs until refactoring webpack to a worker through the Worker aspect.\n const { port, errors } = await this.application.runApp(appName, {\n dev,\n watch: !skipWatch,\n ssr,\n });\n\n if (errors) {\n return {\n code: 1,\n data: <ShowErrors errors={errors} />,\n };\n }\n\n if (port) {\n return (\n <Text>\n {appName} app is running on http://localhost:{port}\n </Text>\n );\n }\n return <Text>{appName} app is running</Text>;\n }\n}\n\nfunction ShowErrors({ errors }: { errors: Error[] }) {\n return (\n <>\n <Newline />\n <Text underline>Fatal {pluralize('error', errors.length)}:</Text>\n {errors.map((x, idx) => (\n <Text key={idx}>{x.toString()}</Text>\n ))}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAYO,MAAMA,MAAM,CAAoB;EAmBrCC,WAAW;EACT;AACJ;AACA;EACYC,WAA4B,EAE5BC,MAAc,EACtB;IAAA,KAHQD,WAA4B,GAA5BA,WAA4B;IAAA,KAE5BC,MAAc,GAAdA,MAAc;IAAA,8CAxBjB,gBAAgB;IAAA,qDACT,8CAA8C;IAAA,mDAChD,CACV;MACEC,IAAI,EAAE,UAAU;MAChBC,WAAW,EACT;IACJ,CAAC,CACF;IAAA,+CACO,GAAG;IAAA,+CACH,MAAM;IAAA,iDACJ,CACR,CAAC,GAAG,EAAE,KAAK,EAAE,oCAAoC,CAAC,EAClD,CAAC,GAAG,EAAE,SAAS,EAAE,8DAA8D,CAAC,EAChF,CAAC,EAAE,EAAE,YAAY,EAAE,4EAA4E,CAAC,EAChG,CAAC,EAAE,EAAE,KAAK,EAAE,wCAAwC,CAAC,CACtD;EASE;EAEH,MAAMC,MAAM,CAAC,CAACC,OAAO,CAAW,EAAE;IAAEC,GAAG;IAAEC,SAAS;IAAEC;EAAgB,CAAC,EAA8C;IACjH;IACA,MAAM;MAAEC,IAAI;MAAEC;IAAO,CAAC,GAAG,MAAM,IAAI,CAACV,WAAW,CAACW,MAAM,CAACN,OAAO,EAAE;MAC9DC,GAAG;MACHM,KAAK,EAAE,CAACL,SAAS;MACjBC;IACF,CAAC,CAAC;IAEF,IAAIE,MAAM,EAAE;MACV,OAAO;QACLG,IAAI,EAAE,CAAC;QACPC,IAAI,eAAE,+BAAC,UAAU;UAAC,MAAM,EAAEJ;QAAO;MACnC,CAAC;IACH;IAEA,IAAID,IAAI,EAAE;MACR,oBACE,+BAAC,WAAI,QACFJ,OAAO,0CAAsCI,IAAI,CAC7C;IAEX;IACA,oBAAO,+BAAC,WAAI,QAAEJ,OAAO,oBAAuB;EAC9C;AACF;AAAC;AAED,SAASU,UAAU,CAAC;EAAEL;AAA4B,CAAC,EAAE;EACnD,oBACE,6EACE,+BAAC,cAAO,OAAG,eACX,+BAAC,WAAI;IAAC,SAAS;EAAA,aAAQ,IAAAM,oBAAS,EAAC,OAAO,EAAEN,MAAM,CAACO,MAAM,CAAC,MAAS,EAChEP,MAAM,CAACQ,GAAG,CAAC,CAACC,CAAC,EAAEC,GAAG,kBACjB,+BAAC,WAAI;IAAC,GAAG,EAAEA;EAAI,GAAED,CAAC,CAACE,QAAQ,EAAE,CAC9B,CAAC,CACD;AAEP"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/application",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.525",
|
|
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.
|
|
9
|
+
"version": "0.0.525"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"@babel/runtime": "7.12.18",
|
|
18
18
|
"core-js": "^3.0.0",
|
|
19
19
|
"@teambit/harmony": "0.3.3",
|
|
20
|
-
"@teambit/builder": "0.0.
|
|
21
|
-
"@teambit/component": "0.0.
|
|
22
|
-
"@teambit/isolator": "0.0.
|
|
23
|
-
"@teambit/envs": "0.0.
|
|
20
|
+
"@teambit/builder": "0.0.883",
|
|
21
|
+
"@teambit/component": "0.0.883",
|
|
22
|
+
"@teambit/isolator": "0.0.883",
|
|
23
|
+
"@teambit/envs": "0.0.883",
|
|
24
24
|
"@teambit/cli-table": "0.0.40",
|
|
25
25
|
"@teambit/cli": "0.0.591",
|
|
26
|
-
"@teambit/aspect-loader": "0.0.
|
|
26
|
+
"@teambit/aspect-loader": "0.0.883",
|
|
27
27
|
"@teambit/bit-error": "0.0.400",
|
|
28
28
|
"@teambit/logger": "0.0.684",
|
|
29
|
-
"@teambit/workspace": "0.0.
|
|
29
|
+
"@teambit/workspace": "0.0.883"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "^17.0.8",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.525/dist/application.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.525/dist/application.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|