@adobe/alloy 2.30.0-beta.2 → 2.30.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.
@@ -14,4 +14,4 @@ governing permissions and limitations under the License.
14
14
  */
15
15
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
16
16
  // see babel-plugin-version
17
- var _default = exports.default = "2.30.0-beta.2";
17
+ var _default = exports.default = "2.30.0";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- var _serviceWorkerNotificationClickListener = require("./helpers/serviceWorkerNotificationClickListener.js");
4
- var _serviceWorkerPushListener = require("./helpers/serviceWorkerPushListener.js");
5
- var _makeSendServiceWorkerTrackingData = require("./request/makeSendServiceWorkerTrackingData.js");
3
+ var _serviceWorkerNotificationClickListener = require("./components/PushNotifications/helpers/serviceWorkerNotificationClickListener.js");
4
+ var _serviceWorkerPushListener = require("./components/PushNotifications/helpers/serviceWorkerPushListener.js");
5
+ var _makeSendServiceWorkerTrackingData = require("./components/PushNotifications/request/makeSendServiceWorkerTrackingData.js");
6
6
  /*
7
7
  Copyright 2025 Adobe. All rights reserved.
8
8
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -15,7 +15,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
15
15
  governing permissions and limitations under the License.
16
16
  */
17
17
 
18
- /** @import { ServiceWorkerLogger } from './types.js' */
18
+ /** @import { ServiceWorkerLogger } from './components/PushNotifications/types.js' */
19
19
 
20
20
  /* eslint-disable no-console */
21
21
  /* eslint-disable no-underscore-dangle */
@@ -13,4 +13,4 @@ governing permissions and limitations under the License.
13
13
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
14
14
  // see babel-plugin-version
15
15
 
16
- export default "2.30.0-beta.2";
16
+ export default "2.30.0";
@@ -10,11 +10,11 @@ OF ANY KIND, either express or implied. See the License for the specific languag
10
10
  governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- /** @import { ServiceWorkerLogger } from './types.js' */
13
+ /** @import { ServiceWorkerLogger } from './components/PushNotifications/types.js' */
14
14
 
15
- import serviceWorkerNotificationClickListener from "./helpers/serviceWorkerNotificationClickListener.js";
16
- import serviceWorkerPushListener from "./helpers/serviceWorkerPushListener.js";
17
- import makeSendServiceWorkerTrackingData from "./request/makeSendServiceWorkerTrackingData.js";
15
+ import serviceWorkerNotificationClickListener from "./components/PushNotifications/helpers/serviceWorkerNotificationClickListener.js";
16
+ import serviceWorkerPushListener from "./components/PushNotifications/helpers/serviceWorkerPushListener.js";
17
+ import makeSendServiceWorkerTrackingData from "./components/PushNotifications/request/makeSendServiceWorkerTrackingData.js";
18
18
 
19
19
  /* eslint-disable no-console */
20
20
  /* eslint-disable no-underscore-dangle */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.30.0-beta.2",
3
+ "version": "2.30.0",
4
4
  "description": "Adobe Experience Platform Web SDK",
5
5
  "type": "module",
6
6
  "main": "libEs5/index.js",
@@ -43,8 +43,8 @@
43
43
  "test:functional:build:int": "rollup -c --environment BASE_CODE_MIN,STANDALONE,NPM_PACKAGE_LOCAL",
44
44
  "test:functional:build:prod": "rollup -c --environment BASE_CODE_MIN,NPM_PACKAGE_PROD",
45
45
  "test:scripts": "vitest run --config=./scripts/specs/vitest.config.js",
46
- "dev": "concurrently --names build,sandbox \"rollup -c -w --environment SANDBOX\" \"cd sandbox && export REACT_APP_NONCE=321 && pnpm start\"",
47
- "build": "pnpm run clean && rollup -c --environment BASE_CODE_MIN,STANDALONE,STANDALONE_MIN,BUNDLESIZE && echo \"Base Code:\" && cat distTest/baseCode.min.js",
46
+ "dev": "concurrently --names build,sandbox \"rollup -c -w --environment SANDBOX,SANDBOX_SERVICE_WORKER\" \"cd sandbox && export REACT_APP_NONCE=321 && pnpm start\"",
47
+ "build": "pnpm run clean && rollup -c --environment BASE_CODE_MIN,STANDALONE,STANDALONE_MIN,SERVICE_WORKER,SERVICE_WORKER_MIN,BUNDLESIZE && echo \"Base Code:\" && cat distTest/baseCode.min.js",
48
48
  "build:watch": "pnpm run clean && rollup -c --watch --environment BASE_CODE_MIN,STANDALONE",
49
49
  "build:custom": "node scripts/alloyBuilder.js",
50
50
  "prepare": "husky",
@@ -91,7 +91,7 @@
91
91
  "uuid": "^11.1.0"
92
92
  },
93
93
  "devDependencies": {
94
- "@adobe/alloy": "2.30.0-beta.1",
94
+ "@adobe/alloy": "2.30.0-beta.3",
95
95
  "@babel/cli": "^7.28.3",
96
96
  "@babel/plugin-transform-modules-commonjs": "^7.27.1",
97
97
  "@eslint/js": "^9.35.0",
package/rollup.config.js CHANGED
@@ -131,6 +131,10 @@ const NPM_PACKAGE_LOCAL = "NPM_PACKAGE_LOCAL";
131
131
  const NPM_PACKAGE_PROD = "NPM_PACKAGE_PROD";
132
132
  // build the standalone distrobution, but exclude some (specified) modules
133
133
  const CUSTOM_BUILD = "CUSTOM_BUILD";
134
+ // build the service worker (used for push notifications feature).
135
+ const SERVICE_WORKER = "SERVICE_WORKER";
136
+ // build the service worker (used for push notifications feature).
137
+ const SANDBOX_SERVICE_WORKER = "SANDBOX_SERVICE_WORKER";
134
138
  // Add "_MIN" to the end of the option name to build the minified version
135
139
 
136
140
  const dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -144,14 +148,19 @@ const buildPlugins = ({ variant, minify, babelPlugins }) => {
144
148
  mainFields: ["module", "main", "browser"],
145
149
  }),
146
150
  commonjs(),
147
- babel({
148
- envName: "rollup",
149
- babelHelpers: "bundled",
150
- configFile: path.resolve(dirname, "babel.config.js"),
151
- plugins: babelPlugins,
152
- }),
153
151
  ];
154
152
 
153
+ if (variant !== SERVICE_WORKER && variant !== SANDBOX_SERVICE_WORKER) {
154
+ plugins.push(
155
+ babel({
156
+ envName: "rollup",
157
+ babelHelpers: "bundled",
158
+ configFile: path.resolve(dirname, "babel.config.js"),
159
+ plugins: babelPlugins,
160
+ }),
161
+ );
162
+ }
163
+
155
164
  if (INCLUDE_BUNDLESIZE) {
156
165
  plugins.push(
157
166
  bundleSizePlugin({
@@ -178,7 +187,11 @@ const buildPlugins = ({ variant, minify, babelPlugins }) => {
178
187
  plugins.push(terser());
179
188
  }
180
189
  }
181
- if (variant === STANDALONE || variant === CUSTOM_BUILD) {
190
+ if (
191
+ variant === STANDALONE ||
192
+ variant === CUSTOM_BUILD ||
193
+ variant === SERVICE_WORKER
194
+ ) {
182
195
  plugins.push(
183
196
  license({
184
197
  cwd: dirname,
@@ -204,6 +217,22 @@ export const buildConfig = ({
204
217
  const plugins = buildPlugins({ variant, minify, babelPlugins });
205
218
  const minifiedExtension = minify ? ".min" : "";
206
219
 
220
+ if (variant === SERVICE_WORKER || variant === SANDBOX_SERVICE_WORKER) {
221
+ const destDirectory =
222
+ variant === SANDBOX_SERVICE_WORKER ? "sandbox/public/" : "dist/";
223
+ return {
224
+ input: `${dirname}/src/serviceWorker.js`,
225
+ output: [
226
+ {
227
+ file:
228
+ file || `${destDirectory}alloyServiceWorker${minifiedExtension}.js`,
229
+ format: "es",
230
+ },
231
+ ],
232
+ plugins,
233
+ };
234
+ }
235
+
207
236
  if (variant === BASE_CODE) {
208
237
  return {
209
238
  input: "src/baseCode.js",
@@ -217,13 +246,13 @@ export const buildConfig = ({
217
246
  plugins,
218
247
  };
219
248
  }
249
+
220
250
  if (
221
251
  variant === STANDALONE ||
222
252
  variant === SANDBOX ||
223
253
  variant === CUSTOM_BUILD
224
254
  ) {
225
255
  const destDirectory = variant === SANDBOX ? "sandbox/public/" : "dist/";
226
-
227
256
  return {
228
257
  input,
229
258
  output: [
@@ -269,5 +298,7 @@ addConfig(STANDALONE);
269
298
  addConfig(SANDBOX);
270
299
  addConfig(NPM_PACKAGE_LOCAL);
271
300
  addConfig(NPM_PACKAGE_PROD);
301
+ addConfig(SERVICE_WORKER);
302
+ addConfig(SANDBOX_SERVICE_WORKER);
272
303
 
273
304
  export default config;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceWorker.d.ts","sourceRoot":"","sources":["../src/serviceWorker.js"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"serviceWorker.d.ts","sourceRoot":"","sources":["../../../src/components/PushNotifications/serviceWorker.js"],"names":[],"mappings":""}