@shopify/app-bridge-types 0.0.13 → 0.0.14-snapshot-20240910215355

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.14-snapshot-20240910215355
4
+
5
+ ### Patch Changes
6
+
7
+ - [#12](https://github.com/Shopify/extensibility/pull/12) [`a79a42172c1af3412ed40213f89e694ac8ada6dd`](https://github.com/Shopify/extensibility/commit/a79a42172c1af3412ed40213f89e694ac8ada6dd) Thanks [@charlesdobson](https://github.com/charlesdobson)! - structure output in dist dir
8
+
3
9
  All notable changes to this project will be documented in this file.
4
10
 
5
11
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
@@ -63,11 +63,7 @@ interface AdminUser {
63
63
  export interface AppBridgeAttributes {
64
64
  }
65
65
 
66
- interface AppBridgeConfig extends Required<Omit<_AppBridgeConfig, 'disabledFeatures' | 'appOrigins'>>, Pick<_AppBridgeConfig, 'disabledFeatures' | 'appOrigins'> {
67
- experimentalFeatures?: string[];
68
- }
69
-
70
- interface _AppBridgeConfig {
66
+ interface AppBridgeConfig {
71
67
  /**
72
68
  * The client ID provided for your application in the Partner Dashboard.
73
69
  *
@@ -80,12 +76,28 @@ interface _AppBridgeConfig {
80
76
  * This is useful if your app needs to make authenticated requests to a different domain that you control.
81
77
  */
82
78
  appOrigins?: string[];
79
+ /**
80
+ * Configuration options for enabling debug features within the app.
81
+ * Includes options for monitoring performance metrics, such as web vitals.
82
+ *
83
+ * Recommended for use during development and debugging to aid in identifying and resolving performance issues.
84
+ *
85
+ * Generally not recommended for long-term use in production environments.
86
+ *
87
+ */
88
+ debug?: DebugOptions;
83
89
  /**
84
90
  * The features to disable in your app.
85
91
  *
86
92
  * This allows app developers to opt-out of features such as <code>fetch</code>.
87
93
  */
88
94
  disabledFeatures?: string[];
95
+ /**
96
+ * The experimental features to enable in your app.
97
+ *
98
+ * This allows app developers to opt-in to experiement features.
99
+ */
100
+ experimentalFeatures?: string[];
89
101
  /**
90
102
  * The base64-encoded host of the shop that's embedding your app.
91
103
  *
@@ -140,7 +152,7 @@ interface Cart {
140
152
  /**
141
153
  * The total cost of the current cart including discounts, but before taxes and shipping. Value is based on the shop's existing currency settings.
142
154
  */
143
- subtotal: string;
155
+ subTotal: string;
144
156
  /**
145
157
  * The sum of taxes for the current cart. Value is based on the shop's existing currency settings.
146
158
  */
@@ -259,6 +271,18 @@ interface CustomSale {
259
271
  taxable: boolean;
260
272
  }
261
273
 
274
+ interface DebugOptions {
275
+ /**
276
+ * Enables or disables the logging of web performance metrics (Web Vitals) in the browser's console.
277
+ *
278
+ * When set to `true`, the app will log Core Web Vitals (such as LCP, INP, and CLS) and other relevant performance metrics to help developers understand the real-world performance of their app. This can be useful for debugging performance issues during development or in a staging environment.
279
+ *
280
+ * This field is optional and defaults to `false`, meaning that web vitals logging is disabled by default to avoid performance overhead and unnecessary console output in production environments.
281
+ * @defaultValue false
282
+ */
283
+ webVitals?: boolean;
284
+ }
285
+
262
286
  interface Device {
263
287
  /**
264
288
  * The name of the device.
@@ -800,7 +824,7 @@ interface _SaveBarApi {
800
824
  /**
801
825
  * Show leave confirmation dialog if necessary. This promise is resolved when there is no visible save bar or user confirms to leave.
802
826
  */
803
- leaveConfirmation?(): Promise<void>;
827
+ leaveConfirmation(): Promise<void>;
804
828
  }
805
829
 
806
830
  interface ScannerApi {
package/package.json CHANGED
@@ -1,28 +1,32 @@
1
1
  {
2
2
  "name": "@shopify/app-bridge-types",
3
- "version": "0.0.13",
3
+ "version": "0.0.14-snapshot-20240910215355",
4
4
  "description": "Companion types library for the Shopify App Bridge script",
5
+ "private": false,
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "@shopify:registry": "https://registry.npmjs.org"
9
+ },
5
10
  "license": "ISC",
6
- "main": "./index.js",
7
- "module": "./index.mjs",
8
- "types": "./index.d.ts",
11
+ "main": "./dist/index.js",
12
+ "module": "./dist/index.mjs",
13
+ "types": "./dist/index.d.ts",
9
14
  "exports": {
10
- "types": "./index.d.ts",
11
- "module": "./index.mjs",
12
- "import": "./index.mjs",
13
- "default": "./index.js"
14
- },
15
- "scripts": {
16
- "build": "cjyes && node ./scripts/build.mjs"
15
+ "types": "./dist/index.d.ts",
16
+ "module": "./dist/index.mjs",
17
+ "import": "./dist/index.mjs",
18
+ "default": "./dist/index.js"
17
19
  },
18
20
  "devDependencies": {
19
- "cjyes": "^0.3.1"
21
+ "cjyes": "^0.3.1",
22
+ "app-bridge-next": "0.0.1"
20
23
  },
21
24
  "files": [
22
- "index.d.ts",
23
- "shopify.ts",
24
- "index.mjs",
25
- "index.js",
25
+ "dist",
26
26
  "CHANGELOG.md"
27
- ]
28
- }
27
+ ],
28
+ "scripts": {
29
+ "prebuild": "mkdir -p ./dist && touch ./dist/index.mjs",
30
+ "build": "npm run prebuild && cjyes && node ./scripts/build.mjs"
31
+ }
32
+ }
File without changes
File without changes
File without changes