zephyr-webpack-plugin 0.0.20 → 0.0.22
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/LICENSE +38 -38
- package/dist/delegate-module/zephyr-delegate.d.ts +1 -5
- package/dist/delegate-module/zephyr-delegate.js +49 -30
- package/dist/delegate-module/zephyr-delegate.js.map +1 -1
- package/dist/federation-dashboard-legacy/get-build-stats.js +1 -2
- package/dist/federation-dashboard-legacy/get-build-stats.js.map +1 -1
- package/dist/federation-dashboard-legacy/get-dashboard-data.d.ts +1 -1
- package/dist/federation-dashboard-legacy/get-dashboard-data.js +66 -66
- package/dist/federation-dashboard-legacy/get-dashboard-data.js.map +1 -1
- package/dist/lib/dependency-resolution/replace-remotes-with-delegates.d.ts +1 -2
- package/dist/lib/dependency-resolution/replace-remotes-with-delegates.js +4 -5
- package/dist/lib/dependency-resolution/replace-remotes-with-delegates.js.map +1 -1
- package/dist/lib/with-zephyr.js +5 -9
- package/dist/lib/with-zephyr.js.map +1 -1
- package/dist/lib/ze-agent/index.js +35 -22
- package/dist/lib/ze-agent/index.js.map +1 -1
- package/dist/lib/ze-setup-build-id.js +29 -23
- package/dist/lib/ze-setup-build-id.js.map +1 -1
- package/dist/lib/ze-setup-build-steps-logging.js +3 -2
- package/dist/lib/ze-setup-build-steps-logging.js.map +1 -1
- package/dist/lib/ze-setup-ze-deploy.js +3 -1
- package/dist/lib/ze-setup-ze-deploy.js.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +3 -3
- package/dist/lib/dependency-resolution/resolve-remote-dependencies.d.ts +0 -5
- package/dist/lib/dependency-resolution/resolve-remote-dependencies.js +0 -32
- package/dist/lib/dependency-resolution/resolve-remote-dependencies.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
...
|
|
13
|
-
|
|
14
|
-
END OF TERMS AND CONDITIONS
|
|
15
|
-
|
|
16
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
17
|
-
|
|
18
|
-
To apply the Apache License to your work, attach the following
|
|
19
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
20
|
-
replaced with your own identifying information. (Don't include
|
|
21
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
22
|
-
comment syntax for the file format. We also recommend that a
|
|
23
|
-
file or class name and description of purpose be included on the
|
|
24
|
-
same line as the copyright notice for each file. The "copyright"
|
|
25
|
-
word should be left as is (without quotes).
|
|
26
|
-
|
|
27
|
-
Copyright [2023] [Zephyr Cloud]
|
|
28
|
-
|
|
29
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
30
|
-
you may not use this file except in compliance with the License.
|
|
31
|
-
You may obtain a copy of the License at
|
|
32
|
-
|
|
33
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
-
|
|
35
|
-
Unless required by applicable law or agreed to in writing, software
|
|
36
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
37
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
38
|
-
See the License for the specific language governing permissions and
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
...
|
|
13
|
+
|
|
14
|
+
END OF TERMS AND CONDITIONS
|
|
15
|
+
|
|
16
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
17
|
+
|
|
18
|
+
To apply the Apache License to your work, attach the following
|
|
19
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
20
|
+
replaced with your own identifying information. (Don't include
|
|
21
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
22
|
+
comment syntax for the file format. We also recommend that a
|
|
23
|
+
file or class name and description of purpose be included on the
|
|
24
|
+
same line as the copyright notice for each file. The "copyright"
|
|
25
|
+
word should be left as is (without quotes).
|
|
26
|
+
|
|
27
|
+
Copyright [2023] [Zephyr Cloud]
|
|
28
|
+
|
|
29
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
30
|
+
you may not use this file except in compliance with the License.
|
|
31
|
+
You may obtain a copy of the License at
|
|
32
|
+
|
|
33
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
+
|
|
35
|
+
Unless required by applicable law or agreed to in writing, software
|
|
36
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
37
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
38
|
+
See the License for the specific language governing permissions and
|
|
39
39
|
limitations under the License.
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { DelegateConfig } from '../lib/dependency-resolution/replace-remotes-with-delegates';
|
|
2
|
-
export
|
|
3
|
-
error: boolean;
|
|
4
|
-
application_uid: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function replace_remote_in_mf_config(mfPlugin: any, config: DelegateConfig): Promise<(DependencyResolutionError | void)[] | void>;
|
|
2
|
+
export declare function replace_remote_in_mf_config(mfPlugin: any, config: DelegateConfig): Promise<void>;
|
|
7
3
|
interface ResolvedDependency {
|
|
8
4
|
remote_name: string;
|
|
9
5
|
default_url: string;
|
|
@@ -4,8 +4,9 @@ exports.replace_remote_with_delegate = exports.replace_remote_in_mf_config = voi
|
|
|
4
4
|
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
5
5
|
// todo: in order to become federation impl agnostic, we should parse and provide
|
|
6
6
|
// already processed federation config instead of mfConfig
|
|
7
|
-
async function resolve_remote_dependency({
|
|
8
|
-
const resolveDependency = new URL(`${zephyr_edge_contract_1.ze_api_gateway.resolve}/${encodeURIComponent(
|
|
7
|
+
async function resolve_remote_dependency({ application_uid, version, }) {
|
|
8
|
+
const resolveDependency = new URL(`${zephyr_edge_contract_1.ze_api_gateway.resolve}/${encodeURIComponent(application_uid)}/${encodeURIComponent(version)}`, (0, zephyr_edge_contract_1.ZE_API_ENDPOINT)());
|
|
9
|
+
const [appName, projectName, orgName] = application_uid.split('.');
|
|
9
10
|
try {
|
|
10
11
|
const token = await (0, zephyr_edge_contract_1.getToken)();
|
|
11
12
|
const res = await fetch(resolveDependency, {
|
|
@@ -17,23 +18,47 @@ async function resolve_remote_dependency({ name, version }) {
|
|
|
17
18
|
},
|
|
18
19
|
});
|
|
19
20
|
if (!res.ok) {
|
|
20
|
-
throw new
|
|
21
|
+
throw new zephyr_edge_contract_1.ZephyrError(zephyr_edge_contract_1.ZeErrors.ERR_RESOLVE_REMOTES, {
|
|
22
|
+
appUid: application_uid,
|
|
23
|
+
appName,
|
|
24
|
+
projectName,
|
|
25
|
+
orgName,
|
|
26
|
+
data: {
|
|
27
|
+
url: resolveDependency.toString(),
|
|
28
|
+
version,
|
|
29
|
+
error: await res.json().catch(() => res.text()),
|
|
30
|
+
},
|
|
31
|
+
});
|
|
21
32
|
}
|
|
22
|
-
const response =
|
|
23
|
-
|
|
33
|
+
const response = await res.json();
|
|
34
|
+
if (response.value) {
|
|
35
|
+
return response.value;
|
|
36
|
+
}
|
|
37
|
+
throw new zephyr_edge_contract_1.ZephyrError(zephyr_edge_contract_1.ZeErrors.ERR_RESOLVE_REMOTES, {
|
|
38
|
+
appUid: application_uid,
|
|
39
|
+
appName,
|
|
40
|
+
projectName,
|
|
41
|
+
orgName,
|
|
42
|
+
data: { version, response },
|
|
43
|
+
});
|
|
24
44
|
}
|
|
25
|
-
catch (
|
|
26
|
-
|
|
45
|
+
catch (cause) {
|
|
46
|
+
throw new zephyr_edge_contract_1.ZephyrError(zephyr_edge_contract_1.ZeErrors.ERR_CANNOT_RESOLVE_APP_NAME_WITH_VERSION, {
|
|
47
|
+
data: { version },
|
|
48
|
+
cause,
|
|
49
|
+
});
|
|
27
50
|
}
|
|
28
51
|
}
|
|
29
52
|
async function replace_remote_in_mf_config(
|
|
30
53
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
54
|
mfPlugin, config) {
|
|
32
|
-
if (!mfPlugin._options?.remotes)
|
|
55
|
+
if (!mfPlugin._options?.remotes) {
|
|
33
56
|
return;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
}
|
|
58
|
+
// Replace remotes with delegate function
|
|
59
|
+
await Promise.all(Object.keys(mfPlugin._options.remotes).map(async (key) => {
|
|
60
|
+
const [app_name, project_name, org_name] = key.split('.', 3);
|
|
61
|
+
// Key might be only the app name
|
|
37
62
|
const application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
|
|
38
63
|
org: org_name ?? config.org,
|
|
39
64
|
project: project_name ?? config.project,
|
|
@@ -41,28 +66,22 @@ mfPlugin, config) {
|
|
|
41
66
|
});
|
|
42
67
|
// if default url is url - set as default, if not use app remote_host as default
|
|
43
68
|
// if default url is not url - send it as a semver to deps resolution
|
|
44
|
-
const resolvedDependency = await resolve_remote_dependency({
|
|
45
|
-
|
|
69
|
+
const [ok, error, resolvedDependency] = await zephyr_edge_contract_1.ZeUtils.PromiseTuple(resolve_remote_dependency({
|
|
70
|
+
application_uid: application_uid,
|
|
46
71
|
version: mfPlugin._options?.remotes[key],
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (_version?.indexOf('@') !== -1) {
|
|
52
|
-
const [v_app] = _version.split('@');
|
|
53
|
-
resolvedDependency.remote_entry_url = [v_app, resolvedDependency.remote_entry_url].join('@');
|
|
54
|
-
}
|
|
55
|
-
resolvedDependency.remote_name = key;
|
|
56
|
-
mfPlugin._options.remotes[key] = replace_remote_with_delegate(resolvedDependency);
|
|
72
|
+
}));
|
|
73
|
+
// If couldn't resolve remote dependency, skip replacing it
|
|
74
|
+
if (!ok || error) {
|
|
75
|
+
return;
|
|
57
76
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
77
|
+
resolvedDependency.library_type = mfPlugin._options?.library?.type ?? 'var';
|
|
78
|
+
const [v_app] = mfPlugin._options.remotes[key]?.split('@') ?? [];
|
|
79
|
+
if (v_app) {
|
|
80
|
+
resolvedDependency.remote_entry_url = [v_app, resolvedDependency.remote_entry_url].join('@');
|
|
63
81
|
}
|
|
64
|
-
|
|
65
|
-
|
|
82
|
+
resolvedDependency.remote_name = key;
|
|
83
|
+
mfPlugin._options.remotes[key] = replace_remote_with_delegate(resolvedDependency);
|
|
84
|
+
}));
|
|
66
85
|
}
|
|
67
86
|
exports.replace_remote_in_mf_config = replace_remote_in_mf_config;
|
|
68
87
|
function replace_remote_with_delegate(deps) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zephyr-delegate.js","sourceRoot":"","sources":["../../src/delegate-module/zephyr-delegate.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"zephyr-delegate.js","sourceRoot":"","sources":["../../src/delegate-module/zephyr-delegate.ts"],"names":[],"mappings":";;;AAAA,+DAAuI;AAOvI,iFAAiF;AACjF,0DAA0D;AAE1D,KAAK,UAAU,yBAAyB,CAAC,EACvC,eAAe,EACf,OAAO,GAIR;IACC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC/B,GAAG,qCAAc,CAAC,OAAO,IAAI,kBAAkB,CAAC,eAAe,CAAC,IAAI,kBAAkB,CAAC,OAAO,CAAC,EA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CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;gBAC7B,CAAC,EACD,WAAW,EACX,WAAW,CACZ,CAAC;gBACF,OAAO;YACT,CAAC;YAED,OAAO,IAAI,QAAQ,CAAC,kBAAkB,SAAS,IAAI,CAAC,EAAE;iBACnD,IAAI,CAAC,CAAC,GAAY,EAAE,EAAE;gBACrB,IAAI,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,WAAW,EAAE,CAAC;oBAC7C,OAAO,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;gBACpC,CAAC;gBAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,sCAAsC,gBAAgB,EAAE,EAAE,GAAG,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -20,8 +20,7 @@ function getBuildStats({ stats, stats_json, pluginOptions, EDGE_URL, DOMAIN, PLA
|
|
|
20
20
|
pluginOptions,
|
|
21
21
|
});
|
|
22
22
|
if (!convertedGraph) {
|
|
23
|
-
|
|
24
|
-
throw new Error('Failed to convert graph to dashboard data');
|
|
23
|
+
throw new zephyr_edge_contract_1.ZephyrError(zephyr_edge_contract_1.ZeErrors.ERR_CONVERT_GRAPH_TO_DASHBOARD);
|
|
25
24
|
}
|
|
26
25
|
const version = (0, zephyr_edge_contract_1.createSnapshotId)(pluginOptions);
|
|
27
26
|
const { app, git } = pluginOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-build-stats.js","sourceRoot":"","sources":["../../src/federation-dashboard-legacy/get-build-stats.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,+
|
|
1
|
+
{"version":3,"file":"get-build-stats.js","sourceRoot":"","sources":["../../src/federation-dashboard-legacy/get-build-stats.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,+DAA4G;AAE5G,6GAA0G;AAE1G,SAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,GAML;IACC,IAAA,6BAAM,EAAC,6DAA6D,CAAC,CAAC;IACtE,MAAM,eAAe,GAAG,IAAI,qDAAyB,CAAC;QACpD,GAAG,EAAE,aAAa,CAAC,GAAG;QACtB,GAAG,EAAE,aAAa,CAAC,GAAG;QACtB,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,CAAC;IAEH,IAAA,6BAAM,EAAC,uBAAuB,CAAC,CAAC;IAChC,MAAM,cAAc,GAAG,eAAe,CAAC,mBAAmB,CAAC;QACzD,KAAK;QACL,UAAU;QACV,aAAa;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,kCAAW,CAAC,+BAAQ,CAAC,8BAA8B,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,uCAAgB,EAAC,aAAa,CAAC,CAAC;IAEhD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,aAAa,CAAC;IACnC,MAAM,cAAc,GAAG;QACrB,EAAE,EAAE,aAAa,CAAC,eAAe;QACjC,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,IAAI;QAClC,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;QACvB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxE,OAAO;QACP,GAAG;QACH,MAAM,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ;QACxC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC;QAC3D,OAAO,EAAE;YACP,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;KACF,CAAC;IAEF,oBAAoB;IACpB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IAC9D,IAAA,6BAAM,EAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,GAAG,CAAC;AACb,CAAC;AA1DD,sCA0DC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDashboardData = void 0;
|
|
4
|
-
const FederationDashboardPlugin_1 = require("./utils/federation-dashboard-plugin/FederationDashboardPlugin");
|
|
5
4
|
const isCI = require("is-ci");
|
|
6
5
|
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
6
|
+
const FederationDashboardPlugin_1 = require("./utils/federation-dashboard-plugin/FederationDashboardPlugin");
|
|
7
7
|
function getDashboardData({ stats, stats_json, pluginOptions, EDGE_URL, PLATFORM, TYPE, }) {
|
|
8
8
|
(0, zephyr_edge_contract_1.ze_log)('getDashboardData started. create federation dashboard plugin');
|
|
9
9
|
const dashboardPlugin = new FederationDashboardPlugin_1.FederationDashboardPlugin({
|
|
@@ -19,71 +19,71 @@ function getDashboardData({ stats, stats_json, pluginOptions, EDGE_URL, PLATFORM
|
|
|
19
19
|
stats_json,
|
|
20
20
|
pluginOptions,
|
|
21
21
|
});
|
|
22
|
-
if (!convertedGraph)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
22
|
+
if (!convertedGraph) {
|
|
23
|
+
throw new zephyr_edge_contract_1.ZephyrError(zephyr_edge_contract_1.ZeErrors.ERR_CONVERT_GRAPH_TO_DASHBOARD);
|
|
24
|
+
}
|
|
25
|
+
// todo: what we need here:
|
|
26
|
+
// - dependencies, devDependencies, peerDependencies
|
|
27
|
+
// - overrides [
|
|
28
|
+
// {
|
|
29
|
+
// "id": "react-dom",
|
|
30
|
+
// "name": "react-dom",
|
|
31
|
+
// "version": "18.2.0",
|
|
32
|
+
// "location": "react-dom",
|
|
33
|
+
// "applicationID": "react-dom"
|
|
34
|
+
// },
|
|
35
|
+
// {
|
|
36
|
+
// "id": "react",
|
|
37
|
+
// "name": "react",
|
|
38
|
+
// "version": "18.2.0",
|
|
39
|
+
// "location": "react",
|
|
40
|
+
// "applicationID": "react"
|
|
41
|
+
// }
|
|
42
|
+
// ]
|
|
43
|
+
// - consumes [
|
|
44
|
+
// {
|
|
45
|
+
// "consumingApplicationID": "GreenRecos",
|
|
46
|
+
// "applicationID": "team-green",
|
|
47
|
+
// "name": "GreenRecos",
|
|
48
|
+
// "usedIn": [
|
|
49
|
+
// {
|
|
50
|
+
// "file": "src/app/team-red-layout.tsx",
|
|
51
|
+
// "url": "/src/app/team-red-layout.tsx"
|
|
52
|
+
// }
|
|
53
|
+
// ]
|
|
54
|
+
// },
|
|
55
|
+
// {
|
|
56
|
+
// "consumingApplicationID": "BlueBasket",
|
|
57
|
+
// "applicationID": "team-blue",
|
|
58
|
+
// "name": "BlueBasket",
|
|
59
|
+
// "usedIn": [
|
|
60
|
+
// {
|
|
61
|
+
// "file": "src/app/team-red-layout.tsx",
|
|
62
|
+
// "url": "/src/app/team-red-layout.tsx"
|
|
63
|
+
// }
|
|
64
|
+
// ]
|
|
65
|
+
// },
|
|
66
|
+
// {
|
|
67
|
+
// "consumingApplicationID": "BlueBuy",
|
|
68
|
+
// "applicationID": "team-blue",
|
|
69
|
+
// "name": "BlueBuy",
|
|
70
|
+
// "usedIn": [
|
|
71
|
+
// {
|
|
72
|
+
// "file": "src/app/team-red-layout.tsx",
|
|
73
|
+
// "url": "/src/app/team-red-layout.tsx"
|
|
74
|
+
// }
|
|
75
|
+
// ]
|
|
76
|
+
// }
|
|
77
|
+
// ]
|
|
78
|
+
// - modules [
|
|
79
|
+
// {
|
|
80
|
+
// "id": "TeamRedLayout:TeamRedLayout",
|
|
81
|
+
// "name": "TeamRedLayout",
|
|
82
|
+
// "applicationID": "TeamRedLayout",
|
|
83
|
+
// "requires": [],
|
|
84
|
+
// "file": "./src/app/team-red-layout"
|
|
85
|
+
// }
|
|
86
|
+
// ]
|
|
87
87
|
const version = (0, zephyr_edge_contract_1.createSnapshotId)(pluginOptions);
|
|
88
88
|
const { app, git } = pluginOptions;
|
|
89
89
|
const data_overrides = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-dashboard-data.js","sourceRoot":"","sources":["../../src/federation-dashboard-legacy/get-dashboard-data.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"get-dashboard-data.js","sourceRoot":"","sources":["../../src/federation-dashboard-legacy/get-dashboard-data.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,+DAAuG;AAEvG,6GAA0G;AAE1G,SAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,IAAI,GAKL;IACC,IAAA,6BAAM,EAAC,8DAA8D,CAAC,CAAC;IACvE,MAAM,eAAe,GAAG,IAAI,qDAAyB,CAAC;QACpD,GAAG,EAAE,aAAa,CAAC,GAAG;QACtB,GAAG,EAAE,aAAa,CAAC,GAAG;QACtB,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,CAAC;IAEH,IAAA,6BAAM,EAAC,uBAAuB,CAAC,CAAC;IAChC,MAAM,cAAc,GAAG,eAAe,CAAC,mBAAmB,CAAC;QACzD,KAAK;QACL,UAAU;QACV,aAAa;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,kCAAW,CAAC,+BAAQ,CAAC,8BAA8B,CAAC,CAAC;IACjE,CAAC;IAED,2BAA2B;IAC3B,oDAAoD;IACpD,gBAAgB;IAChB,MAAM;IACN,yBAAyB;IACzB,2BAA2B;IAC3B,2BAA2B;IAC3B,+BAA+B;IAC/B,mCAAmC;IACnC,OAAO;IACP,MAAM;IACN,qBAAqB;IACrB,uBAAuB;IACvB,2BAA2B;IAC3B,2BAA2B;IAC3B,+BAA+B;IAC/B,MAAM;IACN,IAAI;IACJ,eAAe;IACf,MAAM;IACN,8CAA8C;IAC9C,qCAAqC;IACrC,4BAA4B;IAC5B,kBAAkB;IAClB,UAAU;IACV,iDAAiD;IACjD,gDAAgD;IAChD,UAAU;IACV,QAAQ;IACR,OAAO;IACP,MAAM;IACN,8CAA8C;IAC9C,oCAAoC;IACpC,4BAA4B;I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,EAAE,CAAC,CAAC;IACxD,OAAO,GAAG,CAAC;AACb,CAAC;AArHD,4CAqHC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { DependencyResolutionError } from '../../delegate-module/zephyr-delegate';
|
|
2
1
|
export interface DelegateConfig {
|
|
3
2
|
org: string;
|
|
4
3
|
project: string;
|
|
5
4
|
application?: undefined;
|
|
6
5
|
}
|
|
7
|
-
export declare function replaceRemotesWithDelegates(_config: unknown, { org, project }: DelegateConfig): Promise<
|
|
6
|
+
export declare function replaceRemotesWithDelegates(_config: unknown, { org, project }: DelegateConfig): Promise<void>;
|
|
@@ -8,11 +8,10 @@ async function replaceRemotesWithDelegates(_config, { org, project }) {
|
|
|
8
8
|
const config = _config;
|
|
9
9
|
const depsResolutionTasks = config.plugins
|
|
10
10
|
?.filter(is_mf_plugin_1.isModuleFederationPlugin)
|
|
11
|
-
?.map(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return Promise.all(depsResolutionTasks ?? []);
|
|
11
|
+
?.map((mfConfig) => (0, zephyr_delegate_1.replace_remote_in_mf_config)(mfConfig, { org, project }));
|
|
12
|
+
if (depsResolutionTasks) {
|
|
13
|
+
await Promise.all(depsResolutionTasks);
|
|
14
|
+
}
|
|
16
15
|
}
|
|
17
16
|
exports.replaceRemotesWithDelegates = replaceRemotesWithDelegates;
|
|
18
17
|
//# sourceMappingURL=replace-remotes-with-delegates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace-remotes-with-delegates.js","sourceRoot":"","sources":["../../../src/lib/dependency-resolution/replace-remotes-with-delegates.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"replace-remotes-with-delegates.js","sourceRoot":"","sources":["../../../src/lib/dependency-resolution/replace-remotes-with-delegates.ts"],"names":[],"mappings":";;;AACA,2EAAoF;AACpF,wDAAiE;AAQ1D,KAAK,UAAU,2BAA2B,CAAC,OAAgB,EAAE,EAAE,GAAG,EAAE,OAAO,EAAkB;IAClG,sEAAsE;IACtE,MAAM,MAAM,GAAG,OAAwB,CAAC;IAExC,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO;QACxC,EAAE,MAAM,CAAC,uCAAwB,CAAC;QAClC,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAA,6CAA2B,EAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAE/E,IAAI,mBAAmB,EAAE,CAAC;QACxB,MAAM,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAXD,kEAWC"}
|
package/dist/lib/with-zephyr.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withZephyr = void 0;
|
|
4
|
-
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
5
4
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
6
|
+
const replace_remotes_with_delegates_1 = require("./dependency-resolution/replace-remotes-with-delegates");
|
|
8
7
|
const get_copy_of_mf_options_1 = require("./utils/get-copy-of-mf-options");
|
|
8
|
+
const ze_webpack_plugin_1 = require("./ze-webpack-plugin");
|
|
9
9
|
function withZephyr(_zephyrOptions) {
|
|
10
10
|
return async function configure(config) {
|
|
11
|
-
/* webpack */
|
|
12
11
|
const path_to_execution_dir = config.context;
|
|
13
12
|
(0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr');
|
|
14
|
-
const [packageJson, gitInfo] = await Promise.all([
|
|
15
|
-
|
|
16
|
-
(0, zephyr_agent_1.getGitInfo)(),
|
|
17
|
-
]);
|
|
18
|
-
await (0, resolve_remote_dependencies_1.resolve_remote_dependencies)(config, {
|
|
13
|
+
const [packageJson, gitInfo] = await Promise.all([(0, zephyr_agent_1.getPackageJson)(path_to_execution_dir), (0, zephyr_agent_1.getGitInfo)()]);
|
|
14
|
+
await (0, replace_remotes_with_delegates_1.replaceRemotesWithDelegates)(config, {
|
|
19
15
|
org: gitInfo.app.org,
|
|
20
16
|
project: gitInfo.app.project,
|
|
21
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/lib/with-zephyr.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/lib/with-zephyr.ts"],"names":[],"mappings":";;;AACA,+CAA0D;AAC1D,+DAAyF;AACzF,2GAAqG;AACrG,2EAAoE;AACpE,2DAAsD;AAEtD,SAAgB,UAAU,CAAC,cAAoC;IAC7D,OAAO,KAAK,UAAU,SAAS,CAAC,MAAqB;QACnD,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,CAAC;QAC7C,IAAA,6BAAM,EAAC,yBAAyB,CAAC,CAAC;QAElC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,6BAAc,EAAC,qBAAqB,CAAC,EAAE,IAAA,yBAAU,GAAE,CAAC,CAAC,CAAC;QAExG,MAAM,IAAA,4DAA2B,EAAC,MAAM,EAAE;YACxC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;YACpB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO;SAC7B,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,IAAA,2CAAkB,EAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,eAAe,GAAG,IAAA,2CAAoB,EAAC;YAC3C,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;YACpB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO;YAC5B,IAAI,EAAE,WAAW,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,EAAE,IAAI,CAClB,IAAI,mCAAe,CAAC;YAClB,eAAe;YACf,GAAG,EAAE;gBACH,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;gBACpB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO;aAC7B;YACD,GAAG,EAAE,OAAO,EAAE,GAAG;YACjB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YAC1D,mBAAmB,EAAE,cAAc,EAAE,mBAAmB;SACzD,CAAC,CACH,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AApCD,gCAoCC"}
|
|
@@ -5,37 +5,50 @@ const zephyr_agent_1 = require("zephyr-agent");
|
|
|
5
5
|
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
6
6
|
const get_build_stats_1 = require("../../federation-dashboard-legacy/get-build-stats");
|
|
7
7
|
const lifecycle_events_1 = require("./lifecycle-events");
|
|
8
|
+
const zephyr_agent_2 = require("zephyr-agent");
|
|
8
9
|
async function webpack_zephyr_agent({ stats, stats_json, assets, pluginOptions }) {
|
|
9
10
|
(0, zephyr_edge_contract_1.ze_log)('zephyr agent started.');
|
|
11
|
+
// Error handled previously
|
|
12
|
+
if (!pluginOptions.application_uid || !pluginOptions.zeConfig.buildId) {
|
|
13
|
+
(0, lifecycle_events_1.emitDeploymentDone)();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
10
16
|
const application_uid = pluginOptions.application_uid;
|
|
11
17
|
const [appConfig, hash_set] = await Promise.all([(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }), (0, zephyr_agent_1.get_hash_list)(application_uid)]);
|
|
12
18
|
const { EDGE_URL, PLATFORM } = appConfig;
|
|
13
19
|
const zeStart = Date.now();
|
|
14
20
|
const assetsMap = await (0, zephyr_agent_1.zeBuildAssetsMap)(pluginOptions, assets);
|
|
15
21
|
const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
assets: {
|
|
19
|
-
assetsMap,
|
|
20
|
-
missingAssets,
|
|
21
|
-
outputPath: pluginOptions.outputPath,
|
|
22
|
-
count: Object.keys(assets).length,
|
|
23
|
-
},
|
|
24
|
-
getDashData: () =>
|
|
25
|
-
// fix: this is bad ts-expect-error
|
|
26
|
-
// @ts-expect-error Type 'ConvertedGraph' is missing the following properties from type 'ZephyrBuildStats': project, tags, app, git, and 3 more.
|
|
27
|
-
(0, get_build_stats_1.getBuildStats)({
|
|
28
|
-
stats,
|
|
29
|
-
stats_json,
|
|
30
|
-
assets,
|
|
22
|
+
try {
|
|
23
|
+
await (0, zephyr_agent_1.upload)({
|
|
31
24
|
pluginOptions,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
assets: {
|
|
26
|
+
assetsMap,
|
|
27
|
+
missingAssets,
|
|
28
|
+
outputPath: pluginOptions.outputPath,
|
|
29
|
+
count: Object.keys(assets).length,
|
|
30
|
+
},
|
|
31
|
+
getDashData: () =>
|
|
32
|
+
// fix: this is bad ts-expect-error
|
|
33
|
+
// @ts-expect-error Type 'ConvertedGraph' is missing the following properties from type 'ZephyrBuildStats': project, tags, app, git, and 3 more.
|
|
34
|
+
(0, get_build_stats_1.getBuildStats)({
|
|
35
|
+
stats,
|
|
36
|
+
stats_json,
|
|
37
|
+
assets,
|
|
38
|
+
pluginOptions,
|
|
39
|
+
EDGE_URL,
|
|
40
|
+
PLATFORM,
|
|
41
|
+
}),
|
|
42
|
+
appConfig,
|
|
43
|
+
zeStart,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
(0, zephyr_agent_2.logFn)('error', zephyr_edge_contract_1.ZephyrError.format(err));
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
(0, lifecycle_events_1.emitDeploymentDone)();
|
|
51
|
+
}
|
|
39
52
|
}
|
|
40
53
|
exports.webpack_zephyr_agent = webpack_zephyr_agent;
|
|
41
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ze-agent/index.ts"],"names":[],"mappings":";;;AACA,+CAAwH;AACxH,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ze-agent/index.ts"],"names":[],"mappings":";;;AACA,+CAAwH;AACxH,+DAAkG;AAClG,uFAAkF;AAClF,yDAAwD;AACxD,+CAAqC;AAS9B,KAAK,UAAU,oBAAoB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAoB;IACvG,IAAA,6BAAM,EAAC,uBAAuB,CAAC,CAAC;IAEhC,2BAA2B;IAC3B,IAAI,CAAC,aAAa,CAAC,eAAe,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtE,IAAA,qCAAkB,GAAE,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAEtD,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,0CAA2B,EAAC,EAAE,eAAe,EAAE,CAAC,EAAE,IAAA,4BAAa,EAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACpI,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,MAAM,IAAA,+BAAgB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAChE,MAAM,aAAa,GAAG,IAAA,iCAAkB,EAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;IAElE,IAAI,CAAC;QACH,MAAM,IAAA,qBAAM,EAAC;YACX,aAAa;YACb,MAAM,EAAE;gBACN,SAAS;gBACT,aAAa;gBACb,UAAU,EAAE,aAAa,CAAC,UAAoB;gBAC9C,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;aAClC;YACD,WAAW,EAAE,GAAG,EAAE;YAChB,mCAAmC;YACnC,gJAAgJ;YAChJ,IAAA,+BAAa,EAAC;gBACZ,KAAK;gBACL,UAAU;gBACV,MAAM;gBACN,aAAa;gBACb,QAAQ;gBACR,QAAQ;aACT,CAAC;YACJ,SAAS;YACT,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAA,oBAAK,EAAC,OAAO,EAAE,kCAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;YAAS,CAAC;QACT,IAAA,qCAAkB,GAAE,CAAC;IACvB,CAAC;AACH,CAAC;AA9CD,oDA8CC"}
|
|
@@ -7,30 +7,36 @@ function setupZephyrConfig(pluginOptions, compiler) {
|
|
|
7
7
|
(0, zephyr_edge_contract_1.ze_log)('Setting Get Zephyr Config hook');
|
|
8
8
|
const { pluginName, zeConfig, application_uid } = pluginOptions;
|
|
9
9
|
compiler.hooks.beforeCompile.tapAsync(pluginName, async (params, cb) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(0, zephyr_edge_contract_1.
|
|
20
|
-
|
|
10
|
+
try {
|
|
11
|
+
await (0, zephyr_agent_1.checkAuth)();
|
|
12
|
+
const [appConfig, buildId] = await Promise.all([
|
|
13
|
+
(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }),
|
|
14
|
+
(0, zephyr_agent_1.getBuildId)(application_uid),
|
|
15
|
+
(0, zephyr_agent_1.get_hash_list)(application_uid),
|
|
16
|
+
]);
|
|
17
|
+
const { username, email, EDGE_URL } = appConfig;
|
|
18
|
+
(0, zephyr_edge_contract_1.ze_log)('Got application configuration', { username, email, EDGE_URL });
|
|
19
|
+
(0, zephyr_edge_contract_1.ze_log)(`Got build id: ${buildId}`);
|
|
20
|
+
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
|
21
|
+
logEvent({
|
|
22
|
+
level: 'info',
|
|
23
|
+
action: 'build:info:user',
|
|
24
|
+
ignore: true,
|
|
25
|
+
message: `Hi ${(0, zephyr_edge_contract_1.cyanBright)(username)}!\n${(0, zephyr_edge_contract_1.white)(application_uid)}${(0, zephyr_edge_contract_1.yellow)(`#${buildId}`)}\n`,
|
|
26
|
+
});
|
|
27
|
+
zeConfig.user = username;
|
|
28
|
+
zeConfig.edge_url = EDGE_URL;
|
|
29
|
+
zeConfig.buildId = buildId;
|
|
30
|
+
return cb();
|
|
31
|
+
}
|
|
32
|
+
catch (cause) {
|
|
33
|
+
const zeError = new zephyr_edge_contract_1.ZephyrError(zephyr_edge_contract_1.ZeErrors.ERR_UNKNOWN, {
|
|
34
|
+
message: 'Failed to get Zephyr configuration',
|
|
35
|
+
cause,
|
|
36
|
+
});
|
|
37
|
+
(0, zephyr_agent_1.logFn)('error', zephyr_edge_contract_1.ZephyrError.format(zeError));
|
|
38
|
+
cb();
|
|
21
39
|
}
|
|
22
|
-
(0, zephyr_edge_contract_1.ze_log)(`Got build id: ${buildId}`);
|
|
23
|
-
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
|
24
|
-
logEvent({
|
|
25
|
-
level: 'info',
|
|
26
|
-
action: 'build:info:user',
|
|
27
|
-
ignore: true,
|
|
28
|
-
message: `Hi ${(0, zephyr_edge_contract_1.cyanBright)(username)}!\n${(0, zephyr_edge_contract_1.white)(application_uid)}${(0, zephyr_edge_contract_1.yellow)(`#${buildId}`)}\n`,
|
|
29
|
-
});
|
|
30
|
-
zeConfig.user = username;
|
|
31
|
-
zeConfig.edge_url = EDGE_URL;
|
|
32
|
-
zeConfig.buildId = buildId;
|
|
33
|
-
return cb();
|
|
34
40
|
});
|
|
35
41
|
}
|
|
36
42
|
exports.setupZephyrConfig = setupZephyrConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-setup-build-id.js","sourceRoot":"","sources":["../../src/lib/ze-setup-build-id.ts"],"names":[],"mappings":";;;AACA,+
|
|
1
|
+
{"version":3,"file":"ze-setup-build-id.js","sourceRoot":"","sources":["../../src/lib/ze-setup-build-id.ts"],"names":[],"mappings":";;;AACA,+CAAgH;AAChH,+DAA0H;AAE1H,SAAgB,iBAAiB,CAAC,aAAkC,EAAE,QAAkB;IACtF,IAAA,6BAAM,EAAC,gCAAgC,CAAC,CAAC;IACzC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,aAAa,CAAC;IAEhE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE;QACrE,IAAI,CAAC;YACH,MAAM,IAAA,wBAAS,GAAE,CAAC;YAElB,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC7C,IAAA,0CAA2B,EAAC,EAAE,eAAe,EAAE,CAAC;gBAChD,IAAA,yBAAU,EAAC,eAAe,CAAC;gBAC3B,IAAA,4BAAa,EAAC,eAAe,CAAC;aAC/B,CAAC,CAAC;YAEH,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;YAChD,IAAA,6BAAM,EAAC,+BAA+B,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;YAEvE,IAAA,6BAAM,EAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;YAEnC,MAAM,QAAQ,GAAG,IAAA,qBAAM,EAAC,aAAa,CAAC,CAAC;YAEvC,QAAQ,CAAC;gBACP,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,iBAAiB;gBACzB,MAAM,EAAE,IAAI;gBACZ,OAAO,EAAE,MAAM,IAAA,iCAAU,EAAC,QAAQ,CAAC,MAAM,IAAA,4BAAK,EAAC,eAAe,CAAC,GAAG,IAAA,6BAAM,EAAC,IAAI,OAAO,EAAE,CAAC,IAAI;aAC5F,CAAC,CAAC;YAEH,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC;YACzB,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;YAE3B,OAAO,EAAE,EAAE,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,IAAI,kCAAW,CAAC,+BAAQ,CAAC,WAAW,EAAE;gBACpD,OAAO,EAAE,oCAAoC;gBAC7C,KAAK;aACN,CAAC,CAAC;YAEH,IAAA,oBAAK,EAAC,OAAO,EAAE,kCAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YAE5C,EAAE,EAAE,CAAC;QACP,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA5CD,8CA4CC"}
|
|
@@ -6,17 +6,18 @@ const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
|
6
6
|
function logBuildSteps(pluginOptions, compiler) {
|
|
7
7
|
const { pluginName, buildEnv } = pluginOptions;
|
|
8
8
|
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
|
9
|
-
let buildStartedAt =
|
|
9
|
+
let buildStartedAt = Date.now();
|
|
10
10
|
compiler.hooks.beforeCompile.tapAsync(pluginName, async (params, cb) => {
|
|
11
11
|
buildStartedAt = Date.now();
|
|
12
12
|
(0, zephyr_edge_contract_1.ze_log)('build started at', buildStartedAt);
|
|
13
13
|
cb();
|
|
14
14
|
});
|
|
15
15
|
compiler.hooks.failed.tap(pluginName, (err) => {
|
|
16
|
+
(0, zephyr_edge_contract_1.ze_log)(`build failed in ${Date.now() - buildStartedAt}ms`);
|
|
16
17
|
logEvent({
|
|
17
18
|
level: 'error',
|
|
18
19
|
action: 'build:failed',
|
|
19
|
-
message:
|
|
20
|
+
message: zephyr_edge_contract_1.ZephyrError.format(err),
|
|
20
21
|
});
|
|
21
22
|
});
|
|
22
23
|
return { buildStartedAt };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-setup-build-steps-logging.js","sourceRoot":"","sources":["../../src/lib/ze-setup-build-steps-logging.ts"],"names":[],"mappings":";;;AACA,+CAAsC;AACtC,+
|
|
1
|
+
{"version":3,"file":"ze-setup-build-steps-logging.js","sourceRoot":"","sources":["../../src/lib/ze-setup-build-steps-logging.ts"],"names":[],"mappings":";;;AACA,+CAAsC;AACtC,+DAAgF;AAEhF,SAAgB,aAAa,CAAC,aAAkC,EAAE,QAAkB;IAClF,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAA,qBAAM,EAAC,aAAa,CAAC,CAAC;IAEvC,IAAI,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEhC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE;QACrE,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC5B,IAAA,6BAAM,EAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;QAC3C,EAAE,EAAE,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE;QAC5C,IAAA,6BAAM,EAAC,mBAAmB,IAAI,CAAC,GAAG,EAAE,GAAG,cAAc,IAAI,CAAC,CAAC;QAE3D,QAAQ,CAAC;YACP,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,cAAc;YACtB,OAAO,EAAE,kCAAW,CAAC,MAAM,CAAC,GAAG,CAAC;SACjC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,cAAc,EAAE,CAAC;AAC5B,CAAC;AAvBD,sCAuBC"}
|
|
@@ -14,7 +14,7 @@ function setupZeDeploy(pluginOptions, compiler) {
|
|
|
14
14
|
const stats = compilation.getStats();
|
|
15
15
|
const stats_json = compilation.getStats().toJson();
|
|
16
16
|
pluginOptions.outputPath = compiler.outputPath;
|
|
17
|
-
process.nextTick(
|
|
17
|
+
process.nextTick(ze_agent_1.webpack_zephyr_agent, {
|
|
18
18
|
stats,
|
|
19
19
|
stats_json,
|
|
20
20
|
assets,
|
|
@@ -23,6 +23,8 @@ function setupZeDeploy(pluginOptions, compiler) {
|
|
|
23
23
|
if (!pluginOptions.wait_for_index_html) {
|
|
24
24
|
await (0, lifecycle_events_1.onDeploymentDone)();
|
|
25
25
|
}
|
|
26
|
+
// empty line to separate logs from other plugins
|
|
27
|
+
console.log();
|
|
26
28
|
});
|
|
27
29
|
});
|
|
28
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-setup-ze-deploy.js","sourceRoot":"","sources":["../../src/lib/ze-setup-ze-deploy.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AAKxC,yCAAoE;AACpE,kEAA+D;AAE/D,SAAgB,aAAa,
|
|
1
|
+
{"version":3,"file":"ze-setup-ze-deploy.js","sourceRoot":"","sources":["../../src/lib/ze-setup-ze-deploy.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AAKxC,yCAAoE;AACpE,kEAA+D;AAE/D,SAAgB,aAAa,CAAC,aAAkC,EAAE,QAAkB;IAClF,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IACrC,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE,EAAE;QAC7D,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CACxC;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,2BAA2B;SAChE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;YAEnD,aAAa,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;YAE/C,OAAO,CAAC,QAAQ,CAAC,+BAAoB,EAAE;gBACrC,KAAK;gBACL,UAAU;gBACV,MAAM;gBACN,aAAa;aACd,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC;gBACvC,MAAM,IAAA,mCAAgB,GAAE,CAAC;YAC3B,CAAC;YAED,iDAAiD;YACjD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AA9BD,sCA8BC"}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-webpack-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"is-ci": "^3.0.1",
|
|
11
11
|
"tslib": "^2.3.0",
|
|
12
12
|
"webpack": "^5.93.0",
|
|
13
|
-
"zephyr-agent": "0.0.
|
|
14
|
-
"zephyr-edge-contract": "0.0.
|
|
13
|
+
"zephyr-agent": "0.0.22",
|
|
14
|
+
"zephyr-edge-contract": "0.0.22"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/is-ci": "^3.0.4",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolve_remote_dependencies = void 0;
|
|
4
|
-
const replace_remotes_with_delegates_1 = require("./replace-remotes-with-delegates");
|
|
5
|
-
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
6
|
-
async function resolve_remote_dependencies(config, app) {
|
|
7
|
-
const resolvedDeps = await (0, replace_remotes_with_delegates_1.replaceRemotesWithDelegates)(config, {
|
|
8
|
-
org: app.org,
|
|
9
|
-
project: app.project,
|
|
10
|
-
});
|
|
11
|
-
const errors = resolvedDeps
|
|
12
|
-
.flat()
|
|
13
|
-
.filter((res) => res && res.error)
|
|
14
|
-
.map((result) => {
|
|
15
|
-
return result.application_uid;
|
|
16
|
-
});
|
|
17
|
-
if (errors?.length) {
|
|
18
|
-
const [sample_app_name, sample_project_name, sample_org_name] = errors[0].split('.');
|
|
19
|
-
throw new Error(`${zephyr_edge_contract_1.brightRedBgName} Could not resolve remote entry points for urls: \n
|
|
20
|
-
${errors.map((str) => `\t- ${str}`).join('\n')}\n\n
|
|
21
|
-
Please build them with Zephyr first or add as Unmanaged applications.\n
|
|
22
|
-
Note: you can read application uid as follows:
|
|
23
|
-
\t - ${sample_app_name} - project.json 'name' field of remote application
|
|
24
|
-
\t - ${sample_project_name} - git repository name
|
|
25
|
-
\t - ${sample_org_name} - git organization name
|
|
26
|
-
|
|
27
|
-
Or join and ask question in our discord: https://zephyr-cloud.io/discord
|
|
28
|
-
`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.resolve_remote_dependencies = resolve_remote_dependencies;
|
|
32
|
-
//# sourceMappingURL=resolve-remote-dependencies.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-remote-dependencies.js","sourceRoot":"","sources":["../../../src/lib/dependency-resolution/resolve-remote-dependencies.ts"],"names":[],"mappings":";;;AACA,qFAA+E;AAE/E,+DAAuD;AAEhD,KAAK,UAAU,2BAA2B,CAC/C,MAAqB,EACrB,GAGC;IAED,MAAM,YAAY,GAAG,MAAM,IAAA,4DAA2B,EAAC,MAAM,EAAE;QAC7D,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,YAAY;SACxB,IAAI,EAAE;SACN,MAAM,CAAC,CAAC,GAAY,EAAE,EAAE,CAAC,GAAG,IAAK,GAAiC,CAAC,KAAK,CAAC;SACzE,GAAG,CAAC,CAAC,MAAe,EAAE,EAAE;QACvB,OAAQ,MAAoC,CAAC,eAAe,CAAC;IAC/D,CAAC,CAAC,CAAC;IACL,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC;QACnB,MAAM,CAAC,eAAe,EAAE,mBAAmB,EAAE,eAAe,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrF,MAAM,IAAI,KAAK,CAAC,GAAG,sCAAe;QAC9B,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;eAGrC,eAAe;eACf,mBAAmB;eACnB,eAAe;;;OAGvB,CAAC,CAAC;IACP,CAAC;AACH,CAAC;AA9BD,kEA8BC"}
|