@repobit/dex-launch 0.3.3 → 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/CHANGELOG.md +20 -0
- package/README.md +80 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.2.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.3.3...@repobit/dex-launch@1.2.0) (2025-04-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **DEX-21820:** added target tests ([6436b75](https://github.com/bitdefender/dex-core/commit/6436b75ad1937da0f9bd932c86c3fe8ba0bf3d54))
|
|
12
|
+
* **DEX-22137:** added documentation ([7aa536f](https://github.com/bitdefender/dex-core/commit/7aa536fbfb44290a30f03819d1e84315310f1303))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.1.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.3.3...@repobit/dex-launch@1.1.0) (2025-04-02)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **DEX-21820:** added target tests ([6436b75](https://github.com/bitdefender/dex-core/commit/6436b75ad1937da0f9bd932c86c3fe8ba0bf3d54))
|
|
22
|
+
* **DEX-22137:** added documentation ([7aa536f](https://github.com/bitdefender/dex-core/commit/7aa536fbfb44290a30f03819d1e84315310f1303))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [0.3.3](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.3.2...@repobit/dex-launch@0.3.3) (2025-03-26)
|
|
7
27
|
|
|
8
28
|
|
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# `@repobit/dex-launch`
|
|
2
|
+
|
|
3
|
+
# Adobe Launch Loader
|
|
4
|
+
|
|
5
|
+
Adobe Launch Loader is a lightweight utility that simplifies the process of dynamically loading Adobe Launch scripts based on a specified environment. It leverages constants and script-loading functions from the dex-utils package to construct the correct URL for the Adobe Launch script and then load it asynchronously into your application.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
The Adobe Launch Loader provides a single abstract class with a static method to load the Adobe Launch script. By specifying an environment (such as `'prod'`, `'stage'`, or `'dev'`), the loader builds the script URL using predefined constants and loads the script into the document. This enables seamless integration with Adobe Launch without hardcoding script URLs in your code.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Key Features
|
|
16
|
+
|
|
17
|
+
- **Dynamic Script Loading:**
|
|
18
|
+
Automatically builds and loads the Adobe Launch script URL based on the given environment.
|
|
19
|
+
|
|
20
|
+
- **Environment Flexibility:**
|
|
21
|
+
Supports multiple environments through a mapping of environment keys to script paths.
|
|
22
|
+
|
|
23
|
+
- **Asynchronous Operation:**
|
|
24
|
+
Uses asynchronous loading, ensuring that your application can continue operating while the script is being loaded.
|
|
25
|
+
|
|
26
|
+
- **Easy Integration:**
|
|
27
|
+
Requires minimal configuration and integrates seamlessly with your existing project using the dex-utils package.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
This package relies on external dependencies:
|
|
34
|
+
- @repobit/dex-utils
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install @repobit/dex-launch
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
# Launch Class
|
|
41
|
+
## Type: Abstract Class
|
|
42
|
+
|
|
43
|
+
## Static Methods:
|
|
44
|
+
- ### load(environment: string): Promise<void>
|
|
45
|
+
- Description:
|
|
46
|
+
Constructs the Adobe Launch script URL based on the provided environment and asynchronously loads the script using the loadScript utility from dex-utils.
|
|
47
|
+
- Parameters:
|
|
48
|
+
environment: string – The current environment (e.g., 'prod', 'stage', or 'dev').
|
|
49
|
+
- Return Type:
|
|
50
|
+
Returns a `Promise<void>` which resolves when the script has been successfully loaded.
|
|
51
|
+
|
|
52
|
+
## Use Case:
|
|
53
|
+
Call this method during your application initialization to dynamically load the Adobe Launch script appropriate for your environment. This approach helps keep your configuration dynamic and decoupled from your codebase.
|
|
54
|
+
|
|
55
|
+
# Usage Example
|
|
56
|
+
Below is an example of how to use the Adobe Launch Loader in your application:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import Launch from '@repobit/dex-launch';
|
|
60
|
+
|
|
61
|
+
// Load the Adobe Launch script for the production environment
|
|
62
|
+
await Launch.load('prod');
|
|
63
|
+
|
|
64
|
+
// After loading, the Adobe Launch script is available for use in your application.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If one wishes to use both Launch and Target in the same project, I recommend using a structure similar to the one below:
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import Launch from '@repobit/dex-launch';
|
|
71
|
+
import Target from '@repobit/dex-target';
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
await Launch.load('prod');
|
|
75
|
+
} catch (e) {
|
|
76
|
+
Target.abort();
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Since Target is dependent on Launch, it is better to Abort all Target operations when we are sure that Launch will not load.
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAgB,MAAM;IAC3B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAgB,MAAM;IAC3B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,WAAqC;QAC5D,MAAM,oBAAoB,GAAG,GAAG,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAE1G,MAAM,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACzC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobit/dex-launch",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Client for Adobe Launch",
|
|
5
5
|
"author": "Constantin Ioan Mihai <iconstantin@bitdefender.com>",
|
|
6
6
|
"homepage": "https://github.com/bitdefender/dex-core#readme",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"volta": {
|
|
36
36
|
"node": "22.14.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "023c3635baa1d3b93ca2fa5876de81e383d34799"
|
|
39
39
|
}
|