@repobit/dex-launch 0.3.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/CHANGELOG.md ADDED
@@ -0,0 +1,106 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
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
+
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)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * **DEX-21085:** add files to package json ([d1fa71f](https://github.com/bitdefender/dex-core/commit/d1fa71f4b89812fa306b7ec0104af52505e87491))
32
+
33
+
34
+
35
+ ## [0.3.2](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.3.1...@repobit/dex-launch@0.3.2) (2025-03-26)
36
+
37
+ **Note:** Version bump only for package @repobit/dex-launch
38
+
39
+
40
+
41
+
42
+
43
+ ## [0.3.1](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.3.0...@repobit/dex-launch@0.3.1) (2025-03-25)
44
+
45
+ **Note:** Version bump only for package @repobit/dex-launch
46
+
47
+
48
+
49
+
50
+
51
+ ## [0.3.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.2.0...@repobit/dex-launch@0.3.0) (2025-03-25)
52
+
53
+
54
+ ### Features
55
+
56
+ * **DEX-22225:** created the data layer and updated target class ([390f327](https://github.com/bitdefender/dex-core/commit/390f327af376e8c70e37d14c5ffd699f60a17275))
57
+
58
+
59
+
60
+ ## [0.2.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.1.4...@repobit/dex-launch@0.2.0) (2025-03-25)
61
+
62
+
63
+ ### Features
64
+
65
+ * **DEX-21805:** change jest to vitest ([8219cf8](https://github.com/bitdefender/dex-core/commit/8219cf88cef6c4290783bb80a8142be0195de13e))
66
+
67
+
68
+
69
+ ## [0.1.4](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.1.3...@repobit/dex-launch@0.1.4) (2025-03-24)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * **DEX-21805:** add jsdom to jest ([c2d1d0b](https://github.com/bitdefender/dex-core/commit/c2d1d0bb0350df4f09f88cf64d3fec59e6a2815d))
75
+ * **DEX-21805:** move build dependecies to root ([e75bb59](https://github.com/bitdefender/dex-core/commit/e75bb59c6c215b6be8167ca136423e577ef10656))
76
+ * **DEX-21805:** update tsconfig for all packages ([01abd44](https://github.com/bitdefender/dex-core/commit/01abd4449f7c950116c3b5b76c6989299ab99aea))
77
+
78
+
79
+
80
+ ## [0.1.3](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.1.1...@repobit/dex-launch@0.1.3) (2025-03-21)
81
+
82
+
83
+ ### Bug Fixes
84
+
85
+ * **DEX-21805:** fix package.json ([487e824](https://github.com/bitdefender/dex-core/commit/487e82449bd5a0e6cd959a509b4f9820952466b6))
86
+
87
+
88
+
89
+ ## [0.1.1](https://github.com/bitdefender/dex-core/compare/@repobit/dex-launch@0.1.0...@repobit/dex-launch@0.1.1) (2025-03-05)
90
+
91
+ **Note:** Version bump only for package @repobit/dex-launch
92
+
93
+
94
+
95
+
96
+
97
+ ## 0.1.0 (2025-03-04)
98
+
99
+
100
+ ### ⚠ BREAKING CHANGES
101
+
102
+ * **DEX-22137:** added launch package
103
+
104
+ ### Features
105
+
106
+ * **DEX-22137:** added launch package ([620e29a](https://github.com/bitdefender/dex-core/commit/620e29a078bddd9acc14e7db094686763a9b9711))
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.
@@ -1,3 +1,3 @@
1
1
  export default abstract class Launch {
2
- static load(environment: string): Promise<void>;
2
+ static load(environment: 'dev' | 'stage' | 'prod'): Promise<void>;
3
3
  }
@@ -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,WAAmB;QAC1C,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"}
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,13 +1,16 @@
1
1
  {
2
2
  "name": "@repobit/dex-launch",
3
- "version": "0.3.2",
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",
7
7
  "license": "ISC",
8
8
  "main": "dist/src/index.js",
9
9
  "files": [
10
- "dist/src"
10
+ "dist/src",
11
+ "README.md",
12
+ "CHANGELOG.md",
13
+ "LICENSE"
11
14
  ],
12
15
  "publishConfig": {
13
16
  "access": "public"
@@ -27,10 +30,10 @@
27
30
  "type": "module",
28
31
  "types": "dist/src/index.d.ts",
29
32
  "dependencies": {
30
- "@repobit/dex-utils": "0.6.0"
33
+ "@repobit/dex-utils": "0.6.1"
31
34
  },
32
35
  "volta": {
33
36
  "node": "22.14.0"
34
37
  },
35
- "gitHead": "5391b27f1542572bf315961e3aecaa0b45b9b00d"
38
+ "gitHead": "023c3635baa1d3b93ca2fa5876de81e383d34799"
36
39
  }