@shopify/shop-minis-cli 0.3.0 → 0.3.2

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.
Files changed (30) hide show
  1. package/build/commands/create/examples/default/AGENTS.md +3 -1
  2. package/build/commands/disable/index.d.ts +2 -0
  3. package/build/commands/disable/index.js +30 -0
  4. package/build/commands/disable/index.js.map +1 -0
  5. package/build/commands/enable/index.d.ts +2 -0
  6. package/build/commands/enable/index.js +30 -0
  7. package/build/commands/enable/index.js.map +1 -0
  8. package/build/dashboard/assets/{index-BQCY2tI5.js → index-E_Uxp0hn.js} +1 -1
  9. package/build/dashboard/index.html +1 -1
  10. package/build/data/mini-toggle.d.ts +6 -0
  11. package/build/data/mini-toggle.js +14 -0
  12. package/build/data/mini-toggle.js.map +1 -0
  13. package/build/data/types/autogenerated/shop-minis-admin-api/gql.d.ts +7 -0
  14. package/build/data/types/autogenerated/shop-minis-admin-api/gql.js +1 -0
  15. package/build/data/types/autogenerated/shop-minis-admin-api/gql.js.map +1 -1
  16. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.d.ts +29 -1244
  17. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js +55 -560
  18. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js.map +1 -1
  19. package/build/program.js +4 -0
  20. package/build/program.js.map +1 -1
  21. package/build/utils/scopes-validation.d.ts +8 -2
  22. package/build/utils/scopes-validation.js +27 -3
  23. package/build/utils/scopes-validation.js.map +1 -1
  24. package/dashboard/dist/assets/{index-BQCY2tI5.js → index-E_Uxp0hn.js} +1 -1
  25. package/dashboard/dist/index.html +1 -1
  26. package/dashboard/node_modules/.modules.yaml +1 -1
  27. package/dashboard/node_modules/.pnpm-workspace-state-v1.json +1 -1
  28. package/dashboard/src/constants.ts +1 -1
  29. package/package.json +1 -1
  30. package/scripts/graphql-codegen.ts +13 -1
@@ -53,7 +53,7 @@ const CustomButton = () => {...} // Wrong if SDK Button exists
53
53
  - **Touch targets**: Minimum 48px height for all interactive elements
54
54
  - **Full-width buttons**: Use `className="w-full"` for primary actions
55
55
  - **List virtualization**: Use `<List>` component for >50 items
56
- - **Safe areas**: Respect device notches and system UI
56
+ - **Safe areas**: Use the `<SafeArea>` component to keep content clear of system UI (home indicator, navigation bar). It works like a `div` — pass classes and styles directly. For specific edges only (e.g., a sticky footer), use `edges={['bottom']}`. You can also use the `useSafeArea()` hook for pixel values or `var(--safe-area-inset-*)` CSS custom properties. **Do not use `env(safe-area-inset-*)`** — it is broken on Android. **Placement**: For apps without a router, wrap your top-level layout in `<SafeArea>`. For apps with a router, use `<SafeArea>` inside each screen/page component — not around the router itself — so each screen can control its own safe area edges independently.
57
57
  - **No hover states**: Design for touch, not mouse interaction
58
58
 
59
59
  ### 3. Performance Constraints
@@ -221,6 +221,7 @@ import {
221
221
  useShopNavigation,
222
222
  useAsyncStorage,
223
223
  useSecureStorage,
224
+ useSafeArea,
224
225
 
225
226
  // Core components
226
227
  Button,
@@ -228,6 +229,7 @@ import {
228
229
  MerchantCard,
229
230
  List,
230
231
  Image,
232
+ SafeArea,
231
233
 
232
234
  // UI components
233
235
  Alert,
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function loadCommand(parentProgram: Command): void;
@@ -0,0 +1,30 @@
1
+ import { Command } from 'commander';
2
+ import { handler as handleError } from '@shopify/cli-kit/node/error';
3
+ import { renderConfirmationPrompt, renderSuccess } from '@shopify/cli-kit/node/ui';
4
+ import { miniToggle } from '../../data/mini-toggle.js';
5
+ import { assertNetworkAndAuth } from '../../utils/common-tasks.js';
6
+ export function loadCommand(parentProgram) {
7
+ const command = new Command()
8
+ .name('disable')
9
+ .description('Disable your Shop Mini.')
10
+ .option('--verbose', 'Print debugging messages.')
11
+ .action(async () => {
12
+ try {
13
+ await assertNetworkAndAuth();
14
+ const shouldContinue = await renderConfirmationPrompt({
15
+ message: 'Are you sure you want to disable your Mini?',
16
+ });
17
+ if (!shouldContinue)
18
+ return;
19
+ await miniToggle({ enable: false });
20
+ renderSuccess({
21
+ headline: 'Mini disabled',
22
+ });
23
+ }
24
+ catch (error) {
25
+ handleError(error);
26
+ }
27
+ });
28
+ parentProgram.addCommand(command);
29
+ }
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/disable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAC,wBAAwB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAA;AAEhF,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAA;AAEhE,MAAM,UAAU,WAAW,CAAC,aAAsB;IAChD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;SAC1B,IAAI,CAAC,SAAS,CAAC;SACf,WAAW,CAAC,yBAAyB,CAAC;SACtC,MAAM,CAAC,WAAW,EAAE,2BAA2B,CAAC;SAChD,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI;YACF,MAAM,oBAAoB,EAAE,CAAA;YAE5B,MAAM,cAAc,GAAG,MAAM,wBAAwB,CAAC;gBACpD,OAAO,EAAE,6CAA6C;aACvD,CAAC,CAAA;YACF,IAAI,CAAC,cAAc;gBAAE,OAAM;YAE3B,MAAM,UAAU,CAAC,EAAC,MAAM,EAAE,KAAK,EAAC,CAAC,CAAA;YAEjC,aAAa,CAAC;gBACZ,QAAQ,EAAE,eAAe;aAC1B,CAAC,CAAA;SACH;QAAC,OAAO,KAAK,EAAE;YACd,WAAW,CAAC,KAAK,CAAC,CAAA;SACnB;IACH,CAAC,CAAC,CAAA;IAEJ,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;AACnC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function loadCommand(parentProgram: Command): void;
@@ -0,0 +1,30 @@
1
+ import { Command } from 'commander';
2
+ import { handler as handleError } from '@shopify/cli-kit/node/error';
3
+ import { renderConfirmationPrompt, renderSuccess } from '@shopify/cli-kit/node/ui';
4
+ import { miniToggle } from '../../data/mini-toggle.js';
5
+ import { assertNetworkAndAuth } from '../../utils/common-tasks.js';
6
+ export function loadCommand(parentProgram) {
7
+ const command = new Command()
8
+ .name('enable')
9
+ .description('Enable your Shop Mini.')
10
+ .option('--verbose', 'Print debugging messages.')
11
+ .action(async () => {
12
+ try {
13
+ await assertNetworkAndAuth();
14
+ const shouldContinue = await renderConfirmationPrompt({
15
+ message: 'Are you sure you want to enable your Mini?',
16
+ });
17
+ if (!shouldContinue)
18
+ return;
19
+ await miniToggle({ enable: true });
20
+ renderSuccess({
21
+ headline: 'Mini enabled',
22
+ });
23
+ }
24
+ catch (error) {
25
+ handleError(error);
26
+ }
27
+ });
28
+ parentProgram.addCommand(command);
29
+ }
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/enable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAC,wBAAwB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAA;AAEhF,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAA;AAEhE,MAAM,UAAU,WAAW,CAAC,aAAsB;IAChD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;SAC1B,IAAI,CAAC,QAAQ,CAAC;SACd,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,WAAW,EAAE,2BAA2B,CAAC;SAChD,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI;YACF,MAAM,oBAAoB,EAAE,CAAA;YAE5B,MAAM,cAAc,GAAG,MAAM,wBAAwB,CAAC;gBACpD,OAAO,EAAE,4CAA4C;aACtD,CAAC,CAAA;YACF,IAAI,CAAC,cAAc;gBAAE,OAAM;YAE3B,MAAM,UAAU,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAA;YAEhC,aAAa,CAAC;gBACZ,QAAQ,EAAE,cAAc;aACzB,CAAC,CAAA;SACH;QAAC,OAAO,KAAK,EAAE;YACd,WAAW,CAAC,KAAK,CAAC,CAAA;SACnB;IACH,CAAC,CAAC,CAAA;IAEJ,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;AACnC,CAAC"}