@amplifyup/sdk 0.2.5 → 0.3.1-uat.104.gfd92fe0
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/README.md +29 -1
- package/dist/{AmplifyRenderer-eGtn5k9_.d.mts → AmplifyRenderer-CwAYY8K1.d.mts} +1 -1
- package/dist/{AmplifyRenderer-CTwblDs3.d.ts → AmplifyRenderer-D40crBWY.d.ts} +1 -1
- package/dist/AmplifyRenderer.d.mts +2 -2
- package/dist/AmplifyRenderer.d.ts +2 -2
- package/dist/AmplifyRenderer.js +1 -1
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +1 -1
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +290 -4
- package/dist/index.d.ts +290 -4
- package/dist/index.js +105 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -7
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +100 -7
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +99 -7
- package/dist/next.mjs.map +1 -1
- package/dist/{query-Bs5o-qmw.d.ts → query-BeQibYGm.d.ts} +1 -1
- package/dist/{query-CYRvyIv0.d.mts → query-CwtZtJX8.d.mts} +1 -1
- package/dist/react.d.mts +6 -6
- package/dist/react.d.ts +6 -6
- package/dist/react.js +2 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +2 -2
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/{types-ffQNIQCK.d.ts → types-CxucvIL6.d.mts} +1 -1
- package/dist/{types-ffQNIQCK.d.mts → types-CxucvIL6.d.ts} +1 -1
- package/package.json +8 -7
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -266
- package/dist/cli.js.map +0 -1
- package/dist/cli.mjs +0 -260
- package/dist/cli.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -121,9 +121,10 @@ The generated `.amplifyup` folder ignores itself in git. Don't edit it.
|
|
|
121
121
|
|
|
122
122
|
### Without the Next plugin
|
|
123
123
|
|
|
124
|
-
For CI steps or non-Next builds, run
|
|
124
|
+
The SDK has no command of its own. For CI steps or non-Next builds, install [`@amplifyup/cli`](https://www.npmjs.com/package/@amplifyup/cli) and run it before your build:
|
|
125
125
|
|
|
126
126
|
```bash
|
|
127
|
+
npm install --save-dev @amplifyup/cli
|
|
127
128
|
npx amplifyup registry # build once
|
|
128
129
|
npx amplifyup registry --watch # rebuild as files are added, renamed or removed
|
|
129
130
|
```
|
|
@@ -134,6 +135,17 @@ If a page uses a component that isn't in your registry, Composer shows a placeho
|
|
|
134
135
|
|
|
135
136
|
---
|
|
136
137
|
|
|
138
|
+
## Upgrading to 0.3
|
|
139
|
+
|
|
140
|
+
0.3 removes the `amplifyup` command from this package. Nothing else changes.
|
|
141
|
+
|
|
142
|
+
| You use | Do this |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| `withAmplifyUp` in `next.config` | Nothing. The plugin still builds your registry. |
|
|
145
|
+
| `amplifyup registry` in a script or CI step | `npm install --save-dev @amplifyup/cli`. The same command and flags now come from there. |
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
137
149
|
## Upgrading from 0.1
|
|
138
150
|
|
|
139
151
|
0.2.0 removes hand-written rendering. `renderComponent` and the `ComponentContextProvider` export are gone, and passing `renderComponent` throws an error that points here.
|
|
@@ -656,6 +668,22 @@ track('Product Viewed', { productId: '123' });
|
|
|
656
668
|
identify('user-123', { email: 'user@example.com' });
|
|
657
669
|
```
|
|
658
670
|
|
|
671
|
+
## Visitor consent
|
|
672
|
+
|
|
673
|
+
Tell Amplify UP what your consent banner learned, so form answers are only kept for visitors who agreed:
|
|
674
|
+
|
|
675
|
+
```typescript
|
|
676
|
+
import { setConsent } from '@amplifyup/sdk';
|
|
677
|
+
|
|
678
|
+
// When the visitor accepts or rejects in your banner:
|
|
679
|
+
setConsent('granted'); // or 'denied'
|
|
680
|
+
|
|
681
|
+
// To forget the choice:
|
|
682
|
+
setConsent(null);
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
The choice is remembered in the browser and sent with every form submission. Then turn on **My consent banner tells Amplify UP** under Forms › Visitor consent. Until you do, Amplify UP treats a visitor who agreed the same as one who didn't, and keeps no answers for either.
|
|
686
|
+
|
|
659
687
|
## Debugging
|
|
660
688
|
|
|
661
689
|
```js
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ComponentType, ReactNode } from 'react';
|
|
3
|
-
import { P as PageConfig } from './types-
|
|
3
|
+
import { P as PageConfig } from './types-CxucvIL6.mjs';
|
|
4
4
|
|
|
5
5
|
declare const REGISTRY_BRAND: unique symbol;
|
|
6
6
|
type SiteComponent = ComponentType<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ComponentType, ReactNode } from 'react';
|
|
3
|
-
import { P as PageConfig } from './types-
|
|
3
|
+
import { P as PageConfig } from './types-CxucvIL6.js';
|
|
4
4
|
|
|
5
5
|
declare const REGISTRY_BRAND: unique symbol;
|
|
6
6
|
type SiteComponent = ComponentType<any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { A as AmplifyRenderer } from './AmplifyRenderer-
|
|
3
|
-
import './types-
|
|
2
|
+
export { A as AmplifyRenderer } from './AmplifyRenderer-CwAYY8K1.mjs';
|
|
3
|
+
import './types-CxucvIL6.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { A as AmplifyRenderer } from './AmplifyRenderer-
|
|
3
|
-
import './types-
|
|
2
|
+
export { A as AmplifyRenderer } from './AmplifyRenderer-D40crBWY.js';
|
|
3
|
+
import './types-CxucvIL6.js';
|
package/dist/AmplifyRenderer.js
CHANGED
|
@@ -3767,7 +3767,7 @@ var assertComponentRegistry = (owner, props) => {
|
|
|
3767
3767
|
}
|
|
3768
3768
|
if (!isComponentRegistry(props.registry)) {
|
|
3769
3769
|
throw new Error(
|
|
3770
|
-
`[Amplify UP] ${owner} needs your component registry. Render <AmplifyPage /> from the generated .amplifyup/component-registry module (created by withAmplifyUp or \`amplifyup registry\`).`
|
|
3770
|
+
`[Amplify UP] ${owner} needs your component registry. Render <AmplifyPage /> from the generated .amplifyup/component-registry module (created by withAmplifyUp or \`amplifyup registry\` from @amplifyup/cli).`
|
|
3771
3771
|
);
|
|
3772
3772
|
}
|
|
3773
3773
|
};
|