zephyr-repack-plugin 1.1.2 → 1.2.0
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/README.md +8 -3
- package/dist/README.md +8 -3
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +40 -4
- package/dist/index.mjs +2 -0
- package/dist/lib/native-target.d.mts +8 -0
- package/dist/lib/native-target.d.ts +8 -0
- package/dist/lib/native-target.js +61 -0
- package/dist/lib/native-target.mjs +20 -0
- package/dist/lib/utils/ze-util-verification.d.mts +22 -0
- package/dist/lib/utils/ze-util-verification.d.ts +1 -0
- package/dist/lib/utils/ze-util-verification.js +51 -29
- package/dist/lib/utils/ze-util-verification.mjs +23 -0
- package/dist/lib/with-zephyr.d.mts +5 -0
- package/dist/lib/with-zephyr.d.ts +3 -2
- package/dist/lib/with-zephyr.js +76 -42
- package/dist/lib/with-zephyr.mjs +59 -0
- package/dist/lib/ze-repack-plugin.d.mts +21 -0
- package/dist/lib/ze-repack-plugin.d.ts +8 -3
- package/dist/lib/ze-repack-plugin.js +53 -9
- package/dist/lib/ze-repack-plugin.mjs +24 -0
- package/dist/type/zephyr-internal-types.d.mts +21 -0
- package/dist/type/zephyr-internal-types.d.ts +4 -3
- package/dist/type/zephyr-internal-types.js +18 -1
- package/dist/type/zephyr-internal-types.mjs +1 -0
- package/package.json +43 -19
- package/dist/index.js.map +0 -1
- package/dist/lib/utils/ze-util-verification.js.map +0 -1
- package/dist/lib/with-zephyr.js.map +0 -1
- package/dist/lib/ze-repack-plugin.js.map +0 -1
- package/dist/package.json +0 -39
- package/dist/type/zephyr-internal-types.js.map +0 -1
- package/eslint.config.mjs +0 -3
package/README.md
CHANGED
|
@@ -37,14 +37,19 @@ bun add --dev zephyr-repack-plugin
|
|
|
37
37
|
|
|
38
38
|
## Usage
|
|
39
39
|
|
|
40
|
+
### Native target compatibility
|
|
41
|
+
|
|
42
|
+
This adapter publishes React Native bundles for `ios` and `android` only.
|
|
43
|
+
`tap-app` is rejected before Re.Pack resolves remotes or creates a Zephyr build,
|
|
44
|
+
because Re.Pack does not produce the generic ESM artifact required by TAP apps.
|
|
45
|
+
Use an ESM-capable Zephyr adapter for TAP apps instead.
|
|
46
|
+
|
|
40
47
|
Using `zephyr-repack-plugin` by wrapping the Rspack configuration:
|
|
41
48
|
|
|
42
49
|
```js
|
|
43
50
|
const { withZephyr } = require('zephyr-repack-plugin');
|
|
44
51
|
|
|
45
|
-
const config = {
|
|
46
|
-
/** ...rspack configuration */
|
|
47
|
-
};
|
|
52
|
+
const config = {/** ...rspack configuration */};
|
|
48
53
|
|
|
49
54
|
module.exports = withZephyr()(config);
|
|
50
55
|
```
|
package/dist/README.md
CHANGED
|
@@ -37,14 +37,19 @@ bun add --dev zephyr-repack-plugin
|
|
|
37
37
|
|
|
38
38
|
## Usage
|
|
39
39
|
|
|
40
|
+
### Native target compatibility
|
|
41
|
+
|
|
42
|
+
This adapter publishes React Native bundles for `ios` and `android` only.
|
|
43
|
+
`tap-app` is rejected before Re.Pack resolves remotes or creates a Zephyr build,
|
|
44
|
+
because Re.Pack does not produce the generic ESM artifact required by TAP apps.
|
|
45
|
+
Use an ESM-capable Zephyr adapter for TAP apps instead.
|
|
46
|
+
|
|
40
47
|
Using `zephyr-repack-plugin` by wrapping the Rspack configuration:
|
|
41
48
|
|
|
42
49
|
```js
|
|
43
50
|
const { withZephyr } = require('zephyr-repack-plugin');
|
|
44
51
|
|
|
45
|
-
const config = {
|
|
46
|
-
/** ...rspack configuration */
|
|
47
|
-
};
|
|
52
|
+
const config = {/** ...rspack configuration */};
|
|
48
53
|
|
|
49
54
|
module.exports = withZephyr()(config);
|
|
50
55
|
```
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
withZephyr: ()=>with_zephyr_js_namespaceObject.withZephyr
|
|
32
|
+
});
|
|
33
|
+
const with_zephyr_js_namespaceObject = require("./lib/with-zephyr.js");
|
|
34
|
+
exports.withZephyr = __webpack_exports__.withZephyr;
|
|
35
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
36
|
+
"withZephyr"
|
|
37
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
38
|
+
Object.defineProperty(exports, '__esModule', {
|
|
39
|
+
value: true
|
|
40
|
+
});
|
|
41
|
+
|
|
6
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const REPACK_NATIVE_BUILD_TARGETS: readonly ["ios", "android"];
|
|
2
|
+
export type RepackNativeBuildTarget = (typeof REPACK_NATIVE_BUILD_TARGETS)[number];
|
|
3
|
+
/**
|
|
4
|
+
* Re.Pack produces React Native platform bundles. It cannot publish a generic TAP ESM
|
|
5
|
+
* artifact, even when callers bypass TypeScript with plain JavaScript.
|
|
6
|
+
*/
|
|
7
|
+
export declare function assertRepackNativeBuildTarget(target: unknown, source?: string): asserts target is RepackNativeBuildTarget;
|
|
8
|
+
//# sourceMappingURL=native-target.d.mts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const REPACK_NATIVE_BUILD_TARGETS: readonly ["ios", "android"];
|
|
2
|
+
export type RepackNativeBuildTarget = (typeof REPACK_NATIVE_BUILD_TARGETS)[number];
|
|
3
|
+
/**
|
|
4
|
+
* Re.Pack produces React Native platform bundles. It cannot publish a generic TAP ESM
|
|
5
|
+
* artifact, even when callers bypass TypeScript with plain JavaScript.
|
|
6
|
+
*/
|
|
7
|
+
export declare function assertRepackNativeBuildTarget(target: unknown, source?: string): asserts target is RepackNativeBuildTarget;
|
|
8
|
+
//# sourceMappingURL=native-target.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
const REPACK_NATIVE_BUILD_TARGETS = [
|
|
31
|
+
'ios',
|
|
32
|
+
'android'
|
|
33
|
+
];
|
|
34
|
+
function formatTarget(target) {
|
|
35
|
+
if (void 0 === target) return 'undefined';
|
|
36
|
+
try {
|
|
37
|
+
return JSON.stringify(target) ?? String(target);
|
|
38
|
+
} catch {
|
|
39
|
+
return `<${typeof target}>`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function assertRepackNativeBuildTarget(target, source = 'Re.Pack target') {
|
|
43
|
+
if ('ios' === target || 'android' === target) return;
|
|
44
|
+
throw new TypeError(`${source} must be "ios" or "android"; received ${formatTarget(target)}. Re.Pack cannot publish tap-app artifacts.`);
|
|
45
|
+
}
|
|
46
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
47
|
+
assertRepackNativeBuildTarget: ()=>assertRepackNativeBuildTarget
|
|
48
|
+
}, {
|
|
49
|
+
REPACK_NATIVE_BUILD_TARGETS: REPACK_NATIVE_BUILD_TARGETS
|
|
50
|
+
});
|
|
51
|
+
exports.REPACK_NATIVE_BUILD_TARGETS = __webpack_exports__.REPACK_NATIVE_BUILD_TARGETS;
|
|
52
|
+
exports.assertRepackNativeBuildTarget = __webpack_exports__.assertRepackNativeBuildTarget;
|
|
53
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
54
|
+
"REPACK_NATIVE_BUILD_TARGETS",
|
|
55
|
+
"assertRepackNativeBuildTarget"
|
|
56
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
57
|
+
Object.defineProperty(exports, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=native-target.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
const REPACK_NATIVE_BUILD_TARGETS = [
|
|
3
|
+
'ios',
|
|
4
|
+
'android'
|
|
5
|
+
];
|
|
6
|
+
function formatTarget(target) {
|
|
7
|
+
if (void 0 === target) return 'undefined';
|
|
8
|
+
try {
|
|
9
|
+
return JSON.stringify(target) ?? String(target);
|
|
10
|
+
} catch {
|
|
11
|
+
return `<${typeof target}>`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function assertRepackNativeBuildTarget(target, source = 'Re.Pack target') {
|
|
15
|
+
if ('ios' === target || 'android' === target) return;
|
|
16
|
+
throw new TypeError(`${source} must be "ios" or "android"; received ${formatTarget(target)}. Re.Pack cannot publish tap-app artifacts.`);
|
|
17
|
+
}
|
|
18
|
+
export { REPACK_NATIVE_BUILD_TARGETS, assertRepackNativeBuildTarget };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=native-target.mjs.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ZephyrEngine } from 'zephyr-agent';
|
|
2
|
+
interface RemotesConfig {
|
|
3
|
+
/** Container locations from which modules should be resolved and loaded at runtime. */
|
|
4
|
+
external: string | string[];
|
|
5
|
+
/** The name of the share scope shared with this remote. */
|
|
6
|
+
shareScope?: string;
|
|
7
|
+
}
|
|
8
|
+
interface RemotesObject {
|
|
9
|
+
[index: string]: string | RemotesConfig | string[];
|
|
10
|
+
}
|
|
11
|
+
interface KnownMfConfig {
|
|
12
|
+
config?: {
|
|
13
|
+
name: string;
|
|
14
|
+
library?: {
|
|
15
|
+
type?: string;
|
|
16
|
+
};
|
|
17
|
+
remotes?: (string | RemotesObject)[] | RemotesObject;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare function verify_mf_fastly_config(mf_configs: KnownMfConfig[] | undefined, zephyr_engine: ZephyrEngine): Promise<void>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=ze-util-verification.d.mts.map
|
|
@@ -1,38 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
verify_mf_fastly_config: ()=>verify_mf_fastly_config
|
|
32
|
+
});
|
|
33
|
+
const external_zephyr_agent_namespaceObject = require("zephyr-agent");
|
|
5
34
|
const valid_identifiers = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
6
|
-
// Fastly doesn't allow underscore in domains, reference: https://datatracker.ietf.org/doc/html/rfc1035#:~:text=The%20labels%20must%20follow%20the%20rules%20for%20ARPANET%20host%20names.%20%20They%20must%0Astart%20with%20a%20letter%2C%20end%20with%20a%20letter%20or%20digit%2C%20and%20have%20as%20interior%0Acharacters%20only%20letters%2C%20digits%2C%20and%20hyphen.%20%20There%20are%20also%20some%0Arestrictions%20on%20the%20length.%20%20Labels%20must%20be%2063%20characters%20or%20less.
|
|
7
35
|
const valid_identifier_fastly = /^[a-zA-Z$][a-zA-Z0-9$]*$/;
|
|
8
36
|
async function verify_mf_fastly_config(mf_configs, zephyr_engine) {
|
|
9
|
-
if (!mf_configs)
|
|
10
|
-
return;
|
|
37
|
+
if (!mf_configs) return;
|
|
11
38
|
await zephyr_engine.application_configuration;
|
|
12
|
-
for (const mf_config of mf_configs)
|
|
39
|
+
for (const mf_config of mf_configs){
|
|
13
40
|
const mfConfig = mf_config.config;
|
|
14
|
-
if (!mfConfig)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
// Verify fastly config
|
|
26
|
-
const fastly_condition = !valid_identifier_fastly.test(mfConfig.name) ||
|
|
27
|
-
!valid_identifier_fastly.test(zephyr_engine.application_uid);
|
|
28
|
-
if (condition &&
|
|
29
|
-
!fastly_condition
|
|
30
|
-
// && platform === UploadProviderType.FASTLY
|
|
31
|
-
) {
|
|
32
|
-
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_INVALID_APP_ID, {
|
|
33
|
-
cause: zephyr_agent_1.ZeErrors.ERR_INVALID_APP_ID.message.replace('{{application_uid}}', zephyr_engine.application_uid),
|
|
34
|
-
});
|
|
35
|
-
}
|
|
41
|
+
if (!mfConfig) return;
|
|
42
|
+
const condition = mfConfig?.library?.type === 'var' || void 0 === mfConfig?.library?.type;
|
|
43
|
+
if (condition && !valid_identifiers.test(mfConfig?.name)) throw new external_zephyr_agent_namespaceObject.ZephyrError(external_zephyr_agent_namespaceObject.ZeErrors.ERR_INVALID_MF_CONFIG, {
|
|
44
|
+
cause: external_zephyr_agent_namespaceObject.ZeErrors.ERR_INVALID_MF_CONFIG.message.replace('{{library_name}}', mfConfig.name)
|
|
45
|
+
});
|
|
46
|
+
const fastly_condition = !valid_identifier_fastly.test(mfConfig.name) || !valid_identifier_fastly.test(zephyr_engine.application_uid);
|
|
47
|
+
if (condition && !fastly_condition) throw new external_zephyr_agent_namespaceObject.ZephyrError(external_zephyr_agent_namespaceObject.ZeErrors.ERR_INVALID_APP_ID, {
|
|
48
|
+
cause: external_zephyr_agent_namespaceObject.ZeErrors.ERR_INVALID_APP_ID.message.replace('{{application_uid}}', zephyr_engine.application_uid)
|
|
49
|
+
});
|
|
36
50
|
}
|
|
37
51
|
}
|
|
52
|
+
exports.verify_mf_fastly_config = __webpack_exports__.verify_mf_fastly_config;
|
|
53
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
54
|
+
"verify_mf_fastly_config"
|
|
55
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
56
|
+
Object.defineProperty(exports, '__esModule', {
|
|
57
|
+
value: true
|
|
58
|
+
});
|
|
59
|
+
|
|
38
60
|
//# sourceMappingURL=ze-util-verification.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { ZeErrors, ZephyrError } from "zephyr-agent";
|
|
3
|
+
const valid_identifiers = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
4
|
+
const valid_identifier_fastly = /^[a-zA-Z$][a-zA-Z0-9$]*$/;
|
|
5
|
+
async function verify_mf_fastly_config(mf_configs, zephyr_engine) {
|
|
6
|
+
if (!mf_configs) return;
|
|
7
|
+
await zephyr_engine.application_configuration;
|
|
8
|
+
for (const mf_config of mf_configs){
|
|
9
|
+
const mfConfig = mf_config.config;
|
|
10
|
+
if (!mfConfig) return;
|
|
11
|
+
const condition = mfConfig?.library?.type === 'var' || void 0 === mfConfig?.library?.type;
|
|
12
|
+
if (condition && !valid_identifiers.test(mfConfig?.name)) throw new ZephyrError(ZeErrors.ERR_INVALID_MF_CONFIG, {
|
|
13
|
+
cause: ZeErrors.ERR_INVALID_MF_CONFIG.message.replace('{{library_name}}', mfConfig.name)
|
|
14
|
+
});
|
|
15
|
+
const fastly_condition = !valid_identifier_fastly.test(mfConfig.name) || !valid_identifier_fastly.test(zephyr_engine.application_uid);
|
|
16
|
+
if (condition && !fastly_condition) throw new ZephyrError(ZeErrors.ERR_INVALID_APP_ID, {
|
|
17
|
+
cause: ZeErrors.ERR_INVALID_APP_ID.message.replace('{{application_uid}}', zephyr_engine.application_uid)
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export { verify_mf_fastly_config };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=ze-util-verification.mjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Configuration } from '@rspack/core';
|
|
2
|
+
import type { RepackEnv } from '../type/zephyr-internal-types.mjs';
|
|
3
|
+
import { type ZephyrRepackOptions } from './ze-repack-plugin.mjs';
|
|
4
|
+
export declare function withZephyr(zephyrPluginOptions?: ZephyrRepackOptions): (configFn: (env: RepackEnv) => Configuration) => (config: RepackEnv) => Promise<Configuration>;
|
|
5
|
+
//# sourceMappingURL=with-zephyr.d.mts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Configuration } from '@rspack/core';
|
|
2
2
|
import type { RepackEnv } from '../type/zephyr-internal-types';
|
|
3
|
-
import { type
|
|
4
|
-
export declare function withZephyr(zephyrPluginOptions?:
|
|
3
|
+
import { type ZephyrRepackOptions } from './ze-repack-plugin';
|
|
4
|
+
export declare function withZephyr(zephyrPluginOptions?: ZephyrRepackOptions): (configFn: (env: RepackEnv) => Configuration) => (config: RepackEnv) => Promise<Configuration>;
|
|
5
|
+
//# sourceMappingURL=with-zephyr.d.ts.map
|
package/dist/lib/with-zephyr.js
CHANGED
|
@@ -1,62 +1,96 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
withZephyr: ()=>withZephyr
|
|
32
|
+
});
|
|
33
|
+
const external_zephyr_agent_namespaceObject = require("zephyr-agent");
|
|
34
|
+
const external_zephyr_xpack_internal_namespaceObject = require("zephyr-xpack-internal");
|
|
35
|
+
const external_native_target_js_namespaceObject = require("./native-target.js");
|
|
36
|
+
const ze_util_verification_js_namespaceObject = require("./utils/ze-util-verification.js");
|
|
37
|
+
const external_ze_repack_plugin_js_namespaceObject = require("./ze-repack-plugin.js");
|
|
8
38
|
function withZephyr(zephyrPluginOptions) {
|
|
9
|
-
|
|
10
|
-
return (configFn) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
39
|
+
if (zephyrPluginOptions?.target !== void 0) (0, external_native_target_js_namespaceObject.assertRepackNativeBuildTarget)(zephyrPluginOptions.target, 'withZephyr({ target })');
|
|
40
|
+
return (configFn)=>async (config)=>{
|
|
41
|
+
const platform = config.platform;
|
|
42
|
+
(0, external_native_target_js_namespaceObject.assertRepackNativeBuildTarget)(platform, 'Re.Pack config platform');
|
|
43
|
+
const target = zephyrPluginOptions?.target ?? platform;
|
|
44
|
+
(0, external_native_target_js_namespaceObject.assertRepackNativeBuildTarget)(target, 'withZephyr({ target })');
|
|
15
45
|
const userConfig = configFn({
|
|
16
|
-
platform
|
|
17
|
-
mode: config.mode
|
|
46
|
+
platform,
|
|
47
|
+
mode: config.mode
|
|
18
48
|
});
|
|
19
49
|
const updatedZephyrConfig = {
|
|
20
50
|
...zephyrPluginOptions,
|
|
21
|
-
target
|
|
51
|
+
target
|
|
22
52
|
};
|
|
23
|
-
|
|
24
|
-
// Return the final processed configuration
|
|
53
|
+
external_zephyr_agent_namespaceObject.ze_log.init('updatedZephyrConfig: ', updatedZephyrConfig);
|
|
25
54
|
return _zephyr_configuration(userConfig, updatedZephyrConfig);
|
|
26
55
|
};
|
|
27
|
-
};
|
|
28
56
|
}
|
|
29
57
|
async function _zephyr_configuration(config, _zephyrOptions) {
|
|
58
|
+
const target = _zephyrOptions?.target;
|
|
59
|
+
(0, external_native_target_js_namespaceObject.assertRepackNativeBuildTarget)(target, 'Re.Pack target');
|
|
60
|
+
let zephyr_engine;
|
|
30
61
|
try {
|
|
31
|
-
|
|
32
|
-
const zephyr_engine = await zephyr_agent_1.ZephyrEngine.create({
|
|
62
|
+
zephyr_engine = await external_zephyr_agent_namespaceObject.ZephyrEngine.create({
|
|
33
63
|
builder: 'repack',
|
|
34
|
-
context: config.context
|
|
64
|
+
context: config.context
|
|
35
65
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
zephyr_engine.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
(0,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// Verify Module Federation configuration's naming
|
|
48
|
-
await (0, ze_util_verification_1.verify_mf_fastly_config)(mf_configs, zephyr_engine);
|
|
49
|
-
zephyr_agent_1.ze_log.app('Application uid created...');
|
|
50
|
-
config.plugins?.push(new ze_repack_plugin_1.ZeRepackPlugin({
|
|
66
|
+
external_zephyr_agent_namespaceObject.ze_log.init('Configuring with Zephyr... \n config: ', config);
|
|
67
|
+
zephyr_engine.env.target = target;
|
|
68
|
+
const dependency_pairs = (0, external_zephyr_xpack_internal_namespaceObject.extractFederatedDependencyPairs)(config);
|
|
69
|
+
external_zephyr_agent_namespaceObject.ze_log.init('Resolving and building towards target by zephyr_engine.env.target: ', zephyr_engine.env.target);
|
|
70
|
+
const resolved_dependency_pairs = await zephyr_engine.resolve_remote_dependencies(dependency_pairs, (0, external_zephyr_xpack_internal_namespaceObject.extractLibraryType)(config.output?.library));
|
|
71
|
+
(0, external_zephyr_xpack_internal_namespaceObject.mutWebpackFederatedRemotesConfig)(zephyr_engine, config, resolved_dependency_pairs);
|
|
72
|
+
external_zephyr_agent_namespaceObject.ze_log.remotes('dependency resolution completed successfully...or at least trying to...');
|
|
73
|
+
const mf_configs = (0, external_zephyr_xpack_internal_namespaceObject.makeCopyOfModuleFederationOptions)(config);
|
|
74
|
+
await (0, ze_util_verification_js_namespaceObject.verify_mf_fastly_config)(mf_configs, zephyr_engine);
|
|
75
|
+
external_zephyr_agent_namespaceObject.ze_log.app('Application uid created...');
|
|
76
|
+
config.plugins?.push(new external_ze_repack_plugin_js_namespaceObject.ZeRepackPlugin({
|
|
51
77
|
zephyr_engine,
|
|
52
|
-
mfConfig: (0,
|
|
53
|
-
target
|
|
54
|
-
hooks: _zephyrOptions?.hooks
|
|
78
|
+
mfConfig: (0, external_zephyr_xpack_internal_namespaceObject.makeCopyOfModuleFederationOptions)(config),
|
|
79
|
+
target,
|
|
80
|
+
hooks: _zephyrOptions?.hooks
|
|
55
81
|
}));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
(0,
|
|
82
|
+
} catch (error) {
|
|
83
|
+
if (zephyr_engine?.hasActiveBuild !== false) zephyr_engine?.build_failed();
|
|
84
|
+
(0, external_zephyr_agent_namespaceObject.handleGlobalError)(error);
|
|
59
85
|
}
|
|
60
86
|
return config;
|
|
61
87
|
}
|
|
88
|
+
exports.withZephyr = __webpack_exports__.withZephyr;
|
|
89
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
90
|
+
"withZephyr"
|
|
91
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
92
|
+
Object.defineProperty(exports, '__esModule', {
|
|
93
|
+
value: true
|
|
94
|
+
});
|
|
95
|
+
|
|
62
96
|
//# sourceMappingURL=with-zephyr.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { ZephyrEngine, handleGlobalError, ze_log } from "zephyr-agent";
|
|
3
|
+
import { extractFederatedDependencyPairs, extractLibraryType, makeCopyOfModuleFederationOptions, mutWebpackFederatedRemotesConfig } from "zephyr-xpack-internal";
|
|
4
|
+
import { assertRepackNativeBuildTarget } from "./native-target.mjs";
|
|
5
|
+
import { verify_mf_fastly_config } from "./utils/ze-util-verification.mjs";
|
|
6
|
+
import { ZeRepackPlugin } from "./ze-repack-plugin.mjs";
|
|
7
|
+
function withZephyr(zephyrPluginOptions) {
|
|
8
|
+
if (zephyrPluginOptions?.target !== void 0) assertRepackNativeBuildTarget(zephyrPluginOptions.target, 'withZephyr({ target })');
|
|
9
|
+
return (configFn)=>async (config)=>{
|
|
10
|
+
const platform = config.platform;
|
|
11
|
+
assertRepackNativeBuildTarget(platform, 'Re.Pack config platform');
|
|
12
|
+
const target = zephyrPluginOptions?.target ?? platform;
|
|
13
|
+
assertRepackNativeBuildTarget(target, 'withZephyr({ target })');
|
|
14
|
+
const userConfig = configFn({
|
|
15
|
+
platform,
|
|
16
|
+
mode: config.mode
|
|
17
|
+
});
|
|
18
|
+
const updatedZephyrConfig = {
|
|
19
|
+
...zephyrPluginOptions,
|
|
20
|
+
target
|
|
21
|
+
};
|
|
22
|
+
ze_log.init('updatedZephyrConfig: ', updatedZephyrConfig);
|
|
23
|
+
return _zephyr_configuration(userConfig, updatedZephyrConfig);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async function _zephyr_configuration(config, _zephyrOptions) {
|
|
27
|
+
const target = _zephyrOptions?.target;
|
|
28
|
+
assertRepackNativeBuildTarget(target, 'Re.Pack target');
|
|
29
|
+
let zephyr_engine;
|
|
30
|
+
try {
|
|
31
|
+
zephyr_engine = await ZephyrEngine.create({
|
|
32
|
+
builder: 'repack',
|
|
33
|
+
context: config.context
|
|
34
|
+
});
|
|
35
|
+
ze_log.init('Configuring with Zephyr... \n config: ', config);
|
|
36
|
+
zephyr_engine.env.target = target;
|
|
37
|
+
const dependency_pairs = extractFederatedDependencyPairs(config);
|
|
38
|
+
ze_log.init('Resolving and building towards target by zephyr_engine.env.target: ', zephyr_engine.env.target);
|
|
39
|
+
const resolved_dependency_pairs = await zephyr_engine.resolve_remote_dependencies(dependency_pairs, extractLibraryType(config.output?.library));
|
|
40
|
+
mutWebpackFederatedRemotesConfig(zephyr_engine, config, resolved_dependency_pairs);
|
|
41
|
+
ze_log.remotes('dependency resolution completed successfully...or at least trying to...');
|
|
42
|
+
const mf_configs = makeCopyOfModuleFederationOptions(config);
|
|
43
|
+
await verify_mf_fastly_config(mf_configs, zephyr_engine);
|
|
44
|
+
ze_log.app('Application uid created...');
|
|
45
|
+
config.plugins?.push(new ZeRepackPlugin({
|
|
46
|
+
zephyr_engine,
|
|
47
|
+
mfConfig: makeCopyOfModuleFederationOptions(config),
|
|
48
|
+
target,
|
|
49
|
+
hooks: _zephyrOptions?.hooks
|
|
50
|
+
}));
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (zephyr_engine?.hasActiveBuild !== false) zephyr_engine?.build_failed();
|
|
53
|
+
handleGlobalError(error);
|
|
54
|
+
}
|
|
55
|
+
return config;
|
|
56
|
+
}
|
|
57
|
+
export { withZephyr };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=with-zephyr.mjs.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Compiler } from '@rspack/core';
|
|
2
|
+
import type { ZephyrEngine, ZephyrBuildHooks } from 'zephyr-agent';
|
|
3
|
+
import type { ModuleFederationPlugin } from 'zephyr-xpack-internal';
|
|
4
|
+
import { type RepackNativeBuildTarget } from './native-target.mjs';
|
|
5
|
+
export interface ZephyrRepackPluginOptions {
|
|
6
|
+
zephyr_engine: ZephyrEngine;
|
|
7
|
+
pluginName: string;
|
|
8
|
+
mfConfig: ModuleFederationPlugin[] | ModuleFederationPlugin | undefined;
|
|
9
|
+
target: RepackNativeBuildTarget;
|
|
10
|
+
hooks?: ZephyrBuildHooks;
|
|
11
|
+
}
|
|
12
|
+
export interface ZephyrRepackOptions {
|
|
13
|
+
target?: RepackNativeBuildTarget;
|
|
14
|
+
hooks?: ZephyrBuildHooks;
|
|
15
|
+
}
|
|
16
|
+
export declare class ZeRepackPlugin {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(options: Omit<ZephyrRepackPluginOptions, 'pluginName'>);
|
|
19
|
+
apply(compiler: Compiler): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=ze-repack-plugin.d.mts.map
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { Compiler } from '@rspack/core';
|
|
2
2
|
import type { ZephyrEngine, ZephyrBuildHooks } from 'zephyr-agent';
|
|
3
3
|
import type { ModuleFederationPlugin } from 'zephyr-xpack-internal';
|
|
4
|
-
import type
|
|
4
|
+
import { type RepackNativeBuildTarget } from './native-target';
|
|
5
5
|
export interface ZephyrRepackPluginOptions {
|
|
6
6
|
zephyr_engine: ZephyrEngine;
|
|
7
7
|
pluginName: string;
|
|
8
8
|
mfConfig: ModuleFederationPlugin[] | ModuleFederationPlugin | undefined;
|
|
9
|
-
target:
|
|
9
|
+
target: RepackNativeBuildTarget;
|
|
10
|
+
hooks?: ZephyrBuildHooks;
|
|
11
|
+
}
|
|
12
|
+
export interface ZephyrRepackOptions {
|
|
13
|
+
target?: RepackNativeBuildTarget;
|
|
10
14
|
hooks?: ZephyrBuildHooks;
|
|
11
15
|
}
|
|
12
16
|
export declare class ZeRepackPlugin {
|
|
13
|
-
|
|
17
|
+
#private;
|
|
14
18
|
constructor(options: Omit<ZephyrRepackPluginOptions, 'pluginName'>);
|
|
15
19
|
apply(compiler: Compiler): void;
|
|
16
20
|
}
|
|
21
|
+
//# sourceMappingURL=ze-repack-plugin.d.ts.map
|
|
@@ -1,17 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
ZeRepackPlugin: ()=>ZeRepackPlugin
|
|
32
|
+
});
|
|
33
|
+
const external_zephyr_xpack_internal_namespaceObject = require("zephyr-xpack-internal");
|
|
34
|
+
const external_native_target_js_namespaceObject = require("./native-target.js");
|
|
5
35
|
const pluginName = 'ZephyrRepackPlugin';
|
|
6
36
|
class ZeRepackPlugin {
|
|
7
|
-
|
|
8
|
-
|
|
37
|
+
#options;
|
|
38
|
+
constructor(options){
|
|
39
|
+
(0, external_native_target_js_namespaceObject.assertRepackNativeBuildTarget)(options.target, 'ZeRepackPlugin target');
|
|
40
|
+
this.#options = Object.assign({
|
|
41
|
+
pluginName
|
|
42
|
+
}, options);
|
|
9
43
|
}
|
|
10
44
|
apply(compiler) {
|
|
11
|
-
this.
|
|
12
|
-
(0,
|
|
13
|
-
(
|
|
45
|
+
const engineTarget = this.#options.zephyr_engine.env.target;
|
|
46
|
+
(0, external_native_target_js_namespaceObject.assertRepackNativeBuildTarget)(engineTarget, 'ZeRepackPlugin engine target');
|
|
47
|
+
if (engineTarget !== this.#options.target) throw new TypeError(`ZeRepackPlugin engine target must match target ${JSON.stringify(this.#options.target)}; received ${JSON.stringify(engineTarget)}.`);
|
|
48
|
+
this.#options.zephyr_engine.buildProperties.output = compiler.outputPath;
|
|
49
|
+
(0, external_zephyr_xpack_internal_namespaceObject.logBuildSteps)(this.#options, compiler);
|
|
50
|
+
(0, external_zephyr_xpack_internal_namespaceObject.setupZeDeploy)(this.#options, compiler);
|
|
14
51
|
}
|
|
15
52
|
}
|
|
16
|
-
exports.ZeRepackPlugin = ZeRepackPlugin;
|
|
53
|
+
exports.ZeRepackPlugin = __webpack_exports__.ZeRepackPlugin;
|
|
54
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
55
|
+
"ZeRepackPlugin"
|
|
56
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
57
|
+
Object.defineProperty(exports, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
60
|
+
|
|
17
61
|
//# sourceMappingURL=ze-repack-plugin.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { logBuildSteps, setupZeDeploy } from "zephyr-xpack-internal";
|
|
3
|
+
import { assertRepackNativeBuildTarget } from "./native-target.mjs";
|
|
4
|
+
const pluginName = 'ZephyrRepackPlugin';
|
|
5
|
+
class ZeRepackPlugin {
|
|
6
|
+
#options;
|
|
7
|
+
constructor(options){
|
|
8
|
+
assertRepackNativeBuildTarget(options.target, 'ZeRepackPlugin target');
|
|
9
|
+
this.#options = Object.assign({
|
|
10
|
+
pluginName: pluginName
|
|
11
|
+
}, options);
|
|
12
|
+
}
|
|
13
|
+
apply(compiler) {
|
|
14
|
+
const engineTarget = this.#options.zephyr_engine.env.target;
|
|
15
|
+
assertRepackNativeBuildTarget(engineTarget, 'ZeRepackPlugin engine target');
|
|
16
|
+
if (engineTarget !== this.#options.target) throw new TypeError(`ZeRepackPlugin engine target must match target ${JSON.stringify(this.#options.target)}; received ${JSON.stringify(engineTarget)}.`);
|
|
17
|
+
this.#options.zephyr_engine.buildProperties.output = compiler.outputPath;
|
|
18
|
+
logBuildSteps(this.#options, compiler);
|
|
19
|
+
setupZeDeploy(this.#options, compiler);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export { ZeRepackPlugin };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=ze-repack-plugin.mjs.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Context } from '@rspack/core';
|
|
2
|
+
import type { RepackNativeBuildTarget } from '../lib/native-target.mjs';
|
|
3
|
+
export interface DelegateConfig {
|
|
4
|
+
org: string;
|
|
5
|
+
project: string;
|
|
6
|
+
application?: undefined;
|
|
7
|
+
target?: RepackNativeBuildTarget;
|
|
8
|
+
}
|
|
9
|
+
export interface RepackEnv {
|
|
10
|
+
context?: Context;
|
|
11
|
+
reactNativePath?: string;
|
|
12
|
+
mode?: 'development' | 'production' | undefined;
|
|
13
|
+
devServer?: {
|
|
14
|
+
port?: number;
|
|
15
|
+
host?: string;
|
|
16
|
+
https?: boolean;
|
|
17
|
+
hmr?: boolean;
|
|
18
|
+
};
|
|
19
|
+
platform: RepackNativeBuildTarget | undefined;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=zephyr-internal-types.d.mts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Context } from '@rspack/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RepackNativeBuildTarget } from '../lib/native-target';
|
|
3
3
|
export interface DelegateConfig {
|
|
4
4
|
org: string;
|
|
5
5
|
project: string;
|
|
6
6
|
application?: undefined;
|
|
7
|
-
target?:
|
|
7
|
+
target?: RepackNativeBuildTarget;
|
|
8
8
|
}
|
|
9
9
|
export interface RepackEnv {
|
|
10
10
|
context?: Context;
|
|
@@ -16,5 +16,6 @@ export interface RepackEnv {
|
|
|
16
16
|
https?: boolean;
|
|
17
17
|
hmr?: boolean;
|
|
18
18
|
};
|
|
19
|
-
platform:
|
|
19
|
+
platform: RepackNativeBuildTarget | undefined;
|
|
20
20
|
}
|
|
21
|
+
//# sourceMappingURL=zephyr-internal-types.d.ts.map
|
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
|
|
3
20
|
//# sourceMappingURL=zephyr-internal-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "node:module";
|
package/package.json
CHANGED
|
@@ -1,38 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-repack-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Repack plugin for Zephyr",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/ZephyrCloudIO/zephyr-packages.git",
|
|
8
|
-
"directory": "libs/zephyr-repack-plugin"
|
|
9
|
-
},
|
|
10
5
|
"license": "Apache-2.0",
|
|
11
6
|
"author": {
|
|
12
7
|
"name": "ZephyrCloudIO",
|
|
13
8
|
"url": "https://github.com/ZephyrCloudIO"
|
|
14
9
|
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/ZephyrCloudIO/zephyr-packages.git",
|
|
13
|
+
"directory": "libs/zephyr-repack-plugin"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"!dist/**/*.map"
|
|
20
|
+
],
|
|
15
21
|
"type": "commonjs",
|
|
16
|
-
"main": "dist/index.js",
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"module": "./dist/index.mjs",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
17
25
|
"typings": "dist/index.d.ts",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/index.d.mts",
|
|
30
|
+
"default": "./dist/index.mjs"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json",
|
|
38
|
+
"./*": "./*"
|
|
28
39
|
},
|
|
29
40
|
"publishConfig": {
|
|
30
41
|
"access": "public",
|
|
31
42
|
"provenance": true
|
|
32
43
|
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"zephyr-xpack-internal": "1.2.0",
|
|
46
|
+
"zephyr-agent": "1.2.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@rslib/core": "0.23.2",
|
|
50
|
+
"@rspack/core": "^2.1.3",
|
|
51
|
+
"@rstest/core": "0.11.1",
|
|
52
|
+
"@types/find-package-json": "^1.2.7",
|
|
53
|
+
"typescript": "~5.9.3"
|
|
54
|
+
},
|
|
33
55
|
"scripts": {
|
|
34
|
-
"build": "
|
|
56
|
+
"build": "rslib build",
|
|
35
57
|
"patch-version": "pnpm version",
|
|
36
|
-
"
|
|
58
|
+
"dev": "rslib build --watch",
|
|
59
|
+
"typecheck": "tsc -b",
|
|
60
|
+
"test": "rstest run"
|
|
37
61
|
}
|
|
38
62
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,yGAAA,UAAU,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ze-util-verification.js","sourceRoot":"","sources":["../../../src/lib/utils/ze-util-verification.ts"],"names":[],"mappings":";;AA2BA,0DAgDC;AA3ED,+CAAqD;AAGrD,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AACvD,weAAwe;AACxe,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAsBpD,KAAK,UAAU,uBAAuB,CAC3C,UAAuC,EACvC,aAA2B;IAE3B,IAAI,CAAC,UAAU;QAAE,OAAO;IAExB,MAAM,aAAa,CAAC,yBAAyB,CAAC;IAE9C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC;QAElC,IAAI,CAAC,QAAQ;YAAE,OAAO;QAEtB,MAAM,SAAS,GACb,QAAQ,EAAE,OAAO,EAAE,IAAI,KAAK,KAAK,IAAI,OAAO,QAAQ,EAAE,OAAO,EAAE,IAAI,KAAK,WAAW,CAAC;QAEtF,IACE,SAAS;YACT,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC;QACvC,4CAA4C;UAC5C,CAAC;YACD,MAAM,IAAI,0BAAW,CAAC,uBAAQ,CAAC,qBAAqB,EAAE;gBACpD,KAAK,EAAE,uBAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,OAAO,CACnD,kBAAkB,EAClB,QAAQ,CAAC,IAAI,CACd;aACF,CAAC,CAAC;QACL,CAAC;QAED,uBAAuB;QAEvB,MAAM,gBAAgB,GACpB,CAAC,uBAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC5C,CAAC,uBAAuB,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QAE/D,IACE,SAAS;YACT,CAAC,gBAAgB;QACjB,4CAA4C;UAC5C,CAAC;YACD,MAAM,IAAI,0BAAW,CAAC,uBAAQ,CAAC,kBAAkB,EAAE;gBACjD,KAAK,EAAE,uBAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAChD,qBAAqB,EACrB,aAAa,CAAC,eAAe,CAC9B;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/lib/with-zephyr.ts"],"names":[],"mappings":";;AAkBA,gCA8BC;AA/CD,+CAMsB;AACtB,iEAK+B;AAE/B,uEAAuE;AACvE,yDAAoF;AAEpF,SAAgB,UAAU,CAAC,mBAA+C;IAOxE,2DAA2D;IAC3D,OAAO,CAAC,QAA2C,EAAE,EAAE;QACrD,qFAAqF;QACrF,OAAO,CAAC,MAAiB,EAAE,EAAE;YAC3B,kCAAkC;YAElC,0DAA0D;YAC1D,MAAM,UAAU,GAAG,QAAQ,CAAC;gBAC1B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC,CAAC;YAEH,MAAM,mBAAmB,GAAG;gBAC1B,GAAG,mBAAmB;gBACtB,MAAM,EAAE,MAAM,CAAC,QAAQ;aACK,CAAC;YAE/B,qBAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;YAE1D,2CAA2C;YAC3C,OAAO,qBAAqB,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAChE,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AACD,KAAK,UAAU,qBAAqB,CAClC,MAAqB,EAErB,cAA0C;IAE1C,IAAI,CAAC;QACH,2DAA2D;QAC3D,MAAM,aAAa,GAAG,MAAM,2BAAY,CAAC,MAAM,CAAC;YAC9C,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,CAAC;QACH,qBAAM,CAAC,IAAI,CAAC,wCAAwC,EAAE,MAAM,CAAC,CAAC;QAE9D,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;YAC5B,MAAM,IAAI,0BAAW,CAAC,uBAAQ,CAAC,oBAAoB,CAAC,CAAC;QACvD,CAAC;QACD,aAAa,CAAC,GAAG,CAAC,MAAM,GAAG,cAAc,EAAE,MAAM,CAAC;QAElD,MAAM,gBAAgB,GAAG,IAAA,uDAA+B,EAAC,MAAM,CAAC,CAAC;QAEjE,qBAAM,CAAC,IAAI,CACT,qEAAqE,EACrE,aAAa,CAAC,GAAG,CAAC,MAAM,CACzB,CAAC;QAEF,MAAM,yBAAyB,GAAG,MAAM,aAAa,CAAC,2BAA2B,CAC/E,gBAAgB,EAChB,IAAA,0CAAkB,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAC3C,CAAC;QACF,IAAA,wDAAgC,EAAC,aAAa,EAAE,MAAM,EAAE,yBAAyB,CAAC,CAAC;QAEnF,qBAAM,CAAC,OAAO,CACZ,yEAAyE,CAC1E,CAAC;QAEF,MAAM,UAAU,GAAG,IAAA,yDAAiC,EAAC,MAAM,CAAC,CAAC;QAC7D,kDAAkD;QAClD,MAAM,IAAA,8CAAuB,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAEzD,qBAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,EAAE,IAAI,CAClB,IAAI,iCAAc,CAAC;YACjB,aAAa;YACb,QAAQ,EAAE,IAAA,yDAAiC,EAAC,MAAM,CAAC;YACnD,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,MAAM;YAChC,KAAK,EAAE,cAAc,EAAE,KAAK;SAC7B,CAAC,CACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAA,gCAAiB,EAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ze-repack-plugin.js","sourceRoot":"","sources":["../../src/lib/ze-repack-plugin.ts"],"names":[],"mappings":";;;AAGA,iEAAqE;AAErE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAUxC,MAAa,cAAc;IAGzB,YAAY,OAAsD;QAChE,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;QACzE,IAAA,qCAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvC,IAAA,qCAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF;AAZD,wCAYC"}
|
package/dist/package.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "zephyr-repack-plugin",
|
|
3
|
-
"version": "1.1.2",
|
|
4
|
-
"description": "Repack plugin for Zephyr",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/ZephyrCloudIO/zephyr-packages.git",
|
|
8
|
-
"directory": "libs/zephyr-repack-plugin"
|
|
9
|
-
},
|
|
10
|
-
"license": "Apache-2.0",
|
|
11
|
-
"author": {
|
|
12
|
-
"name": "ZephyrCloudIO",
|
|
13
|
-
"url": "https://github.com/ZephyrCloudIO"
|
|
14
|
-
},
|
|
15
|
-
"type": "commonjs",
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"typings": "dist/index.d.ts",
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "nx build zephyr-repack-plugin",
|
|
20
|
-
"patch-version": "pnpm version",
|
|
21
|
-
"test": "nx test zephyr-repack-plugin"
|
|
22
|
-
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"zephyr-agent": "workspace:*",
|
|
25
|
-
"zephyr-xpack-internal": "workspace:*"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@rspack/core": "catalog:rspack",
|
|
29
|
-
"@types/find-package-json": "^1.2.6",
|
|
30
|
-
"@types/jest": "catalog:typescript",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "catalog:eslint",
|
|
32
|
-
"ts-jest": "catalog:typescript"
|
|
33
|
-
},
|
|
34
|
-
"publishConfig": {
|
|
35
|
-
"access": "public",
|
|
36
|
-
"provenance": true
|
|
37
|
-
},
|
|
38
|
-
"types": "./index.d.ts"
|
|
39
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zephyr-internal-types.js","sourceRoot":"","sources":["../../src/type/zephyr-internal-types.ts"],"names":[],"mappings":""}
|
package/eslint.config.mjs
DELETED