zephyr-modernjs-plugin 0.0.0-canary-20250219113844 → 0.0.35
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/index.d.ts +0 -2
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/dist/modernjs-plugin/with-zephyr.d.ts +2 -2
- package/dist/modernjs-plugin/with-zephyr.js +66 -55
- package/dist/modernjs-plugin/with-zephyr.js.map +1 -1
- package/dist/package.json +15 -6
- package/package.json +17 -8
- package/dist/modernjs-plugin/ze-modernjs-plugin.d.ts +0 -14
- package/dist/modernjs-plugin/ze-modernjs-plugin.js +0 -18
- package/dist/modernjs-plugin/ze-modernjs-plugin.js.map +0 -1
- package/dist/modernjs-plugin/ze-modernjs-upload-agent.d.ts +0 -10
- package/dist/modernjs-plugin/ze-modernjs-upload-agent.js +0 -40
- package/dist/modernjs-plugin/ze-modernjs-upload-agent.js.map +0 -1
- package/dist/modernjs-plugin/ze-setup-build-steps-logging.d.ts +0 -5
- package/dist/modernjs-plugin/ze-setup-build-steps-logging.js +0 -26
- package/dist/modernjs-plugin/ze-setup-build-steps-logging.js.map +0 -1
- package/dist/modernjs-plugin/ze-setup-deploy.d.ts +0 -3
- package/dist/modernjs-plugin/ze-setup-deploy.js +0 -33
- package/dist/modernjs-plugin/ze-setup-deploy.js.map +0 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.withZephyr = void 0;
|
|
4
4
|
var with_zephyr_1 = require("./modernjs-plugin/with-zephyr");
|
|
5
5
|
Object.defineProperty(exports, "withZephyr", { enumerable: true, get: function () { return with_zephyr_1.withZephyr; } });
|
|
6
|
-
// hacks
|
|
7
|
-
var zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
|
|
8
|
-
Object.defineProperty(exports, "onDeploymentDone", { enumerable: true, get: function () { return zephyr_xpack_internal_1.onDeploymentDone; } });
|
|
9
|
-
var zephyr_agent_1 = require("zephyr-agent");
|
|
10
|
-
Object.defineProperty(exports, "resolveIndexHtml", { enumerable: true, get: function () { return zephyr_agent_1.resolveIndexHtml; } });
|
|
11
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAA2D;AAAlD,yGAAA,UAAU,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAA2D;AAAlD,yGAAA,UAAU,OAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ZephyrPluginOptions } from 'zephyr-edge-contract';
|
|
2
|
-
import { AppTools,
|
|
3
|
-
export declare const withZephyr: (zephyrOptions?: ZephyrPluginOptions) =>
|
|
2
|
+
import { AppTools, CliPluginFuture } from '@modern-js/app-tools';
|
|
3
|
+
export declare const withZephyr: (zephyrOptions?: ZephyrPluginOptions) => CliPluginFuture<AppTools<"rspack" | "webpack">>;
|
|
@@ -1,49 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.withZephyr = void 0;
|
|
4
|
-
const ze_modernjs_plugin_1 = require("./ze-modernjs-plugin");
|
|
5
|
-
const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
|
|
6
37
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
7
38
|
const pluginName = 'zephyr-modernjs-plugin';
|
|
8
39
|
const isDev = process.env['NODE_ENV'] === 'development';
|
|
9
40
|
const withZephyr = (zephyrOptions) => ({
|
|
10
41
|
name: pluginName,
|
|
11
42
|
pre: ['@modern-js/plugin-module-federation-config'],
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
config
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
zephyr_engine: zephyrEngine,
|
|
32
|
-
mfConfig,
|
|
33
|
-
wait_for_index_html: zephyrOptions?.wait_for_index_html,
|
|
34
|
-
}));
|
|
35
|
-
},
|
|
36
|
-
rspack(config) {
|
|
37
|
-
config.plugins?.push(new ze_modernjs_plugin_1.ZeModernjsPlugin({
|
|
38
|
-
zephyr_engine: zephyrEngine,
|
|
39
|
-
mfConfig,
|
|
40
|
-
wait_for_index_html: zephyrOptions?.wait_for_index_html,
|
|
41
|
-
}));
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
};
|
|
43
|
+
async setup(api) {
|
|
44
|
+
api.modifyWebpackConfig(async (config, utils) => {
|
|
45
|
+
const currentBundler = api.getAppContext().bundlerType;
|
|
46
|
+
if (currentBundler !== 'webpack') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const { withZephyr } = await Promise.resolve().then(() => __importStar(require('zephyr-webpack-plugin')));
|
|
50
|
+
const z_config = await withZephyr(zephyrOptions)(config);
|
|
51
|
+
utils.mergeConfig(config, z_config);
|
|
52
|
+
});
|
|
53
|
+
api.modifyRspackConfig(async (config, utils) => {
|
|
54
|
+
const currentBundler = api.getAppContext().bundlerType;
|
|
55
|
+
if (currentBundler !== 'rspack') {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const { withZephyr } = await Promise.resolve().then(() => __importStar(require('zephyr-rspack-plugin')));
|
|
59
|
+
const z_config = await withZephyr(zephyrOptions)(config);
|
|
60
|
+
utils.mergeConfig(config, z_config);
|
|
61
|
+
});
|
|
47
62
|
},
|
|
48
63
|
usePlugins: isDev ? [zephyrFixPublicPath()] : [],
|
|
49
64
|
});
|
|
@@ -52,24 +67,20 @@ function zephyrFixPublicPath() {
|
|
|
52
67
|
return {
|
|
53
68
|
name: 'zephyr-publicpath-fix',
|
|
54
69
|
pre: [pluginName],
|
|
55
|
-
setup
|
|
56
|
-
config
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
}),
|
|
72
|
-
}),
|
|
70
|
+
setup(api) {
|
|
71
|
+
api.modifyWebpackConfig(async (config, { isServer }) => {
|
|
72
|
+
if (!isServer) {
|
|
73
|
+
(0, zephyr_agent_1.ze_log)('Modifying publicPath for Dev Server');
|
|
74
|
+
config.output = { ...config.output, publicPath: 'auto' };
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
api.modifyRspackConfig(async (config, { isServer }) => {
|
|
78
|
+
if (!isServer) {
|
|
79
|
+
(0, zephyr_agent_1.ze_log)('Modifying publicPath for Dev Server');
|
|
80
|
+
config.output = { ...config.output, publicPath: 'auto' };
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
},
|
|
73
84
|
};
|
|
74
85
|
}
|
|
75
86
|
//# sourceMappingURL=with-zephyr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/modernjs-plugin/with-zephyr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/modernjs-plugin/with-zephyr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAAsC;AAEtC,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,aAAa,CAAC;AAEjD,MAAM,UAAU,GAAG,CACxB,aAAmC,EACc,EAAE,CAAC,CAAC;IACrD,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,CAAC,4CAA4C,CAAC;IAEnD,KAAK,CAAC,KAAK,CAAC,GAAG;QACb,GAAG,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;YAC9C,MAAM,cAAc,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC,WAAW,CAAC;YACvD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;gBACjC,OAAO;YACT,CAAC;YAED,MAAM,EAAE,UAAU,EAAE,GAAG,wDAAa,uBAAuB,GAAC,CAAC;YAC7D,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;YACzD,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;YAC7C,MAAM,cAAc,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC,WAAW,CAAC;YACvD,IAAI,cAAc,KAAK,QAAQ,EAAE,CAAC;gBAChC,OAAO;YACT,CAAC;YAED,MAAM,EAAE,UAAU,EAAE,GAAG,wDAAa,sBAAsB,GAAC,CAAC;YAC5D,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;YACzD,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;CACjD,CAAC,CAAC;AA/BU,QAAA,UAAU,cA+BpB;AAEH,SAAS,mBAAmB;IAC1B,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,GAAG,EAAE,CAAC,UAAU,CAAC;QACjB,KAAK,CAAC,GAAG;YACP,GAAG,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;gBACrD,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,IAAA,qBAAM,EAAC,qCAAqC,CAAC,CAAC;oBAC9C,MAAM,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;gBAC3D,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;gBACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,IAAA,qBAAM,EAAC,qCAAqC,CAAC,CAAC;oBAC9C,MAAM,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;gBAC3D,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-modernjs-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,19 +10,28 @@
|
|
|
10
10
|
"patch-version": "pnpm version"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@module-federation/automatic-vendor-federation": "1.2.1",
|
|
14
13
|
"is-ci": "^3.0.1",
|
|
15
14
|
"tslib": "^2.3.0",
|
|
16
|
-
"@modern-js/app-tools": "^2.
|
|
15
|
+
"@modern-js/app-tools": "^2.65.0",
|
|
17
16
|
"@module-federation/modern-js": "^0.8.9",
|
|
18
17
|
"zephyr-agent": "workspace:*",
|
|
19
18
|
"zephyr-edge-contract": "workspace:*",
|
|
20
|
-
"zephyr-xpack-internal": "workspace:*"
|
|
21
|
-
"webpack": "5.97.1",
|
|
22
|
-
"@rspack/core": "^1.1.8"
|
|
19
|
+
"zephyr-xpack-internal": "workspace:*"
|
|
23
20
|
},
|
|
24
21
|
"devDependencies": {
|
|
25
22
|
"@types/is-ci": "^3.0.4",
|
|
26
23
|
"@types/node-persist": "^3.1.8"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"zephyr-rspack-plugin": "workspace:*",
|
|
27
|
+
"zephyr-webpack-plugin": "workspace:*"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"zephyr-rspack-plugin": {
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
33
|
+
"zephyr-webpack-plugin": {
|
|
34
|
+
"optional": true
|
|
35
|
+
}
|
|
27
36
|
}
|
|
28
37
|
}
|
package/package.json
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-modernjs-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "commonjs",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@module-federation/automatic-vendor-federation": "1.2.1",
|
|
10
9
|
"is-ci": "^3.0.1",
|
|
11
10
|
"tslib": "^2.3.0",
|
|
12
|
-
"@modern-js/app-tools": "^2.
|
|
11
|
+
"@modern-js/app-tools": "^2.65.0",
|
|
13
12
|
"@module-federation/modern-js": "^0.8.9",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"zephyr-
|
|
17
|
-
"zephyr-edge-contract": "0.0.0-canary-20250219113844",
|
|
18
|
-
"zephyr-xpack-internal": "0.0.0-canary-20250219113844"
|
|
13
|
+
"zephyr-agent": "0.0.35",
|
|
14
|
+
"zephyr-edge-contract": "0.0.35",
|
|
15
|
+
"zephyr-xpack-internal": "0.0.35"
|
|
19
16
|
},
|
|
20
17
|
"devDependencies": {
|
|
21
18
|
"@types/is-ci": "^3.0.4",
|
|
22
19
|
"@types/node-persist": "^3.1.8"
|
|
23
20
|
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"zephyr-rspack-plugin": "0.0.35",
|
|
23
|
+
"zephyr-webpack-plugin": "0.0.35"
|
|
24
|
+
},
|
|
25
|
+
"peerDependenciesMeta": {
|
|
26
|
+
"zephyr-rspack-plugin": {
|
|
27
|
+
"optional": true
|
|
28
|
+
},
|
|
29
|
+
"zephyr-webpack-plugin": {
|
|
30
|
+
"optional": true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
24
33
|
"scripts": {
|
|
25
34
|
"build": "nx run zephyr-modernjs-plugin:build",
|
|
26
35
|
"patch-version": "pnpm version"
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ZephyrEngine } from 'zephyr-agent';
|
|
2
|
-
import { ModuleFederationPlugin } from 'zephyr-xpack-internal';
|
|
3
|
-
import { Compiler } from '@rspack/core';
|
|
4
|
-
export interface ZephyrModernjsInternalPluginOptions {
|
|
5
|
-
zephyr_engine: ZephyrEngine;
|
|
6
|
-
pluginName: string;
|
|
7
|
-
mfConfig: ModuleFederationPlugin[] | ModuleFederationPlugin | undefined;
|
|
8
|
-
wait_for_index_html?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare class ZeModernjsPlugin {
|
|
11
|
-
_options: ZephyrModernjsInternalPluginOptions;
|
|
12
|
-
constructor(options: Omit<ZephyrModernjsInternalPluginOptions, 'pluginName'>);
|
|
13
|
-
apply(compiler: Compiler): void;
|
|
14
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZeModernjsPlugin = void 0;
|
|
4
|
-
const ze_setup_deploy_1 = require("./ze-setup-deploy");
|
|
5
|
-
const ze_setup_build_steps_logging_1 = require("./ze-setup-build-steps-logging");
|
|
6
|
-
const pluginName = 'ZeRspackPlugin';
|
|
7
|
-
class ZeModernjsPlugin {
|
|
8
|
-
constructor(options) {
|
|
9
|
-
this._options = Object.assign({ pluginName }, options);
|
|
10
|
-
}
|
|
11
|
-
apply(compiler) {
|
|
12
|
-
this._options.zephyr_engine.buildProperties.output = compiler.outputPath;
|
|
13
|
-
(0, ze_setup_build_steps_logging_1.logBuildSteps)(this._options, compiler);
|
|
14
|
-
(0, ze_setup_deploy_1.setupZeDeploy)(this._options, compiler);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.ZeModernjsPlugin = ZeModernjsPlugin;
|
|
18
|
-
//# sourceMappingURL=ze-modernjs-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ze-modernjs-plugin.js","sourceRoot":"","sources":["../../src/modernjs-plugin/ze-modernjs-plugin.ts"],"names":[],"mappings":";;;AAEA,uDAAkD;AAClD,iFAA+D;AAI/D,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAapC,MAAa,gBAAgB;IAG3B,YAAY,OAAgE;QAC1E,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC;QAEzE,IAAA,4CAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvC,IAAA,+BAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF;AAbD,4CAaC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type Source } from 'zephyr-edge-contract';
|
|
2
|
-
import { Stats, StatsCompilation } from '@rspack/core';
|
|
3
|
-
import { ZephyrModernjsInternalPluginOptions } from './ze-modernjs-plugin';
|
|
4
|
-
export interface ZephyrAgentProps {
|
|
5
|
-
stats: Stats;
|
|
6
|
-
stats_json: StatsCompilation;
|
|
7
|
-
pluginOptions: ZephyrModernjsInternalPluginOptions;
|
|
8
|
-
assets: Record<string, Source>;
|
|
9
|
-
}
|
|
10
|
-
export declare function modernjs_zephyr_agent({ stats, stats_json, assets, pluginOptions, }: ZephyrAgentProps): Promise<void>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.modernjs_zephyr_agent = void 0;
|
|
4
|
-
const zephyr_agent_1 = require("zephyr-agent");
|
|
5
|
-
const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
|
|
6
|
-
async function modernjs_zephyr_agent({ stats, stats_json, assets, pluginOptions, }) {
|
|
7
|
-
(0, zephyr_agent_1.ze_log)('Initiating: Zephyr Modernjs Upload Agent');
|
|
8
|
-
const zeStart = Date.now();
|
|
9
|
-
const { wait_for_index_html, zephyr_engine } = pluginOptions;
|
|
10
|
-
try {
|
|
11
|
-
const assetsMap = await (0, zephyr_xpack_internal_1.buildWebpackAssetMap)(assets, {
|
|
12
|
-
wait_for_index_html,
|
|
13
|
-
});
|
|
14
|
-
// rspack dash data
|
|
15
|
-
const { EDGE_URL, PLATFORM } = await zephyr_engine.application_configuration;
|
|
16
|
-
const dashData = await (0, zephyr_xpack_internal_1.getBuildStats)({
|
|
17
|
-
stats,
|
|
18
|
-
stats_json,
|
|
19
|
-
assets,
|
|
20
|
-
pluginOptions,
|
|
21
|
-
EDGE_URL,
|
|
22
|
-
PLATFORM,
|
|
23
|
-
});
|
|
24
|
-
await zephyr_engine.upload_assets({
|
|
25
|
-
assetsMap,
|
|
26
|
-
mfConfig: pluginOptions.mfConfig,
|
|
27
|
-
buildStats: dashData,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
(0, zephyr_agent_1.logFn)('error', zephyr_agent_1.ZephyrError.format(err));
|
|
32
|
-
}
|
|
33
|
-
finally {
|
|
34
|
-
(0, zephyr_xpack_internal_1.emitDeploymentDone)();
|
|
35
|
-
// todo: log end
|
|
36
|
-
(0, zephyr_agent_1.ze_log)('Zephyr Rspack Upload Agent: Done in', Date.now() - zeStart, 'ms');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.modernjs_zephyr_agent = modernjs_zephyr_agent;
|
|
40
|
-
//# sourceMappingURL=ze-modernjs-upload-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ze-modernjs-upload-agent.js","sourceRoot":"","sources":["../../src/modernjs-plugin/ze-modernjs-upload-agent.ts"],"names":[],"mappings":";;;AAAA,+CAA0D;AAQ1D,iEAI+B;AASxB,KAAK,UAAU,qBAAqB,CAAC,EAC1C,KAAK,EACL,UAAU,EACV,MAAM,EACN,aAAa,GACI;IACjB,IAAA,qBAAM,EAAC,0CAA0C,CAAC,CAAC;IAEnD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAE7D,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,IAAA,4CAAoB,EAAC,MAAM,EAAE;YACnD,mBAAmB;SACpB,CAAC,CAAC;QAEH,mBAAmB;QACnB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,aAAa,CAAC,yBAAyB,CAAC;QAE7E,MAAM,QAAQ,GAAG,MAAM,IAAA,qCAAa,EAAC;YACnC,KAAK;YACL,UAAU;YACV,MAAM;YACN,aAAa;YACb,QAAQ;YACR,QAAQ;SACT,CAAC,CAAC;QAEH,MAAM,aAAa,CAAC,aAAa,CAAC;YAChC,SAAS;YACT,QAAQ,EAAE,aAAa,CAAC,QAGX;YACb,UAAU,EAAE,QAAuC;SACpD,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAA,oBAAK,EAAC,OAAO,EAAE,0BAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;YAAS,CAAC;QACT,IAAA,0CAAkB,GAAE,CAAC;QACrB,gBAAgB;QAChB,IAAA,qBAAM,EAAC,qCAAqC,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AA3CD,sDA2CC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logBuildSteps = void 0;
|
|
4
|
-
const zephyr_agent_1 = require("zephyr-agent");
|
|
5
|
-
function logBuildSteps(pluginOptions, compiler) {
|
|
6
|
-
const { pluginName } = pluginOptions;
|
|
7
|
-
let buildStartedAt = Date.now();
|
|
8
|
-
compiler.hooks.beforeCompile.tapAsync(pluginName, async (params, cb) => {
|
|
9
|
-
buildStartedAt = Date.now();
|
|
10
|
-
(0, zephyr_agent_1.ze_log)('build started at', buildStartedAt);
|
|
11
|
-
cb();
|
|
12
|
-
});
|
|
13
|
-
compiler.hooks.failed.tap(pluginName, (err) => {
|
|
14
|
-
(0, zephyr_agent_1.ze_log)(`build failed in ${Date.now() - buildStartedAt}ms`);
|
|
15
|
-
pluginOptions.zephyr_engine.logger.then((logger) => {
|
|
16
|
-
logger({
|
|
17
|
-
level: 'error',
|
|
18
|
-
action: 'build:failed',
|
|
19
|
-
message: zephyr_agent_1.ZephyrError.format(err),
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
return { buildStartedAt };
|
|
24
|
-
}
|
|
25
|
-
exports.logBuildSteps = logBuildSteps;
|
|
26
|
-
//# sourceMappingURL=ze-setup-build-steps-logging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ze-setup-build-steps-logging.js","sourceRoot":"","sources":["../../src/modernjs-plugin/ze-setup-build-steps-logging.ts"],"names":[],"mappings":";;;AAEA,+CAAmD;AAEnD,SAAgB,aAAa,CAC3B,aAAkD,EAClD,QAAkB;IAElB,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAErC,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,qBAAM,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,qBAAM,EAAC,mBAAmB,IAAI,CAAC,GAAG,EAAE,GAAG,cAAc,IAAI,CAAC,CAAC;QAE3D,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACjD,MAAM,CAAC;gBACL,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,0BAAW,CAAC,MAAM,CAAC,GAAG,CAAC;aACjC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,cAAc,EAAE,CAAC;AAC5B,CAAC;AA3BD,sCA2BC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupZeDeploy = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const process = tslib_1.__importStar(require("node:process"));
|
|
6
|
-
const ze_modernjs_upload_agent_1 = require("./ze-modernjs-upload-agent");
|
|
7
|
-
const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
|
|
8
|
-
function setupZeDeploy(pluginOptions, compiler) {
|
|
9
|
-
const { pluginName } = pluginOptions;
|
|
10
|
-
compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
|
|
11
|
-
compilation.hooks.processAssets.tapPromise({
|
|
12
|
-
name: pluginName,
|
|
13
|
-
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT,
|
|
14
|
-
}, async (assets) => {
|
|
15
|
-
const stats = compilation.getStats();
|
|
16
|
-
const stats_json = compilation.getStats().toJson();
|
|
17
|
-
await pluginOptions.zephyr_engine.start_new_build();
|
|
18
|
-
process.nextTick(ze_modernjs_upload_agent_1.modernjs_zephyr_agent, {
|
|
19
|
-
stats,
|
|
20
|
-
stats_json,
|
|
21
|
-
assets,
|
|
22
|
-
pluginOptions,
|
|
23
|
-
});
|
|
24
|
-
if (!pluginOptions.wait_for_index_html) {
|
|
25
|
-
await (0, zephyr_xpack_internal_1.onDeploymentDone)();
|
|
26
|
-
}
|
|
27
|
-
// empty line to separate logs from other plugins
|
|
28
|
-
console.log();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
exports.setupZeDeploy = setupZeDeploy;
|
|
33
|
-
//# sourceMappingURL=ze-setup-deploy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ze-setup-deploy.js","sourceRoot":"","sources":["../../src/modernjs-plugin/ze-setup-deploy.ts"],"names":[],"mappings":";;;;AAAA,8DAAwC;AAExC,yEAAmE;AAGnE,iEAAyD;AAEzD,SAAgB,aAAa,CAC3B,aAAkD,EAClD,QAAkB;IAElB,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAErC,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,MAAM,aAAa,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC;YAEpD,OAAO,CAAC,QAAQ,CAAC,gDAAqB,EAAE;gBACtC,KAAK;gBACL,UAAU;gBACV,MAAM;gBACN,aAAa;aACd,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC;gBACvC,MAAM,IAAA,wCAAgB,GAAE,CAAC;YAC3B,CAAC;YAED,iDAAiD;YACjD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAlCD,sCAkCC"}
|