Skip to content

Commit

Permalink
Merge pull request #462 from Shopify/changeset-release/main
Browse files Browse the repository at this point in the history
Packages for release
  • Loading branch information
paulomarg authored Oct 16, 2023
2 parents af9dab4 + 7c26327 commit ab35d95
Show file tree
Hide file tree
Showing 41 changed files with 395 additions and 171 deletions.
5 changes: 0 additions & 5 deletions .changeset/breezy-pandas-nail.md

This file was deleted.

23 changes: 0 additions & 23 deletions .changeset/chilled-bobcats-brush.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eleven-carrots-cross.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/funny-moons-judge.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/green-cats-hunt.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changeset/olive-mayflies-act.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/pink-trainers-try.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/quiet-phones-act.md

This file was deleted.

67 changes: 0 additions & 67 deletions .changeset/serious-nails-own.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/tidy-cycles-dress.md

This file was deleted.

56 changes: 56 additions & 0 deletions packages/shopify-app-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,61 @@
# Changelog

## 3.0.0

### Major Changes

- f837060: **Removed support for Node 14**

Node 14 has reached its [EOL](https://endoflife.date/nodejs), and dependencies to this package no longer work on Node 14.
Because of that, we can no longer support that version.

If your app is running on Node 14, you'll need to update to a more recent version before upgrading this package.

This upgrade does not require any code changes.

#### Changes to the `ShopifyApp` type

Previously, the `ShopifyApp` type accepted 2 generic types: the REST resources and the session storage class.
In v3, that type accepts 1 generic: the params given to the `shopifyApp()` function, which contains both of the previous types, and more.

Apps shouldn't need to use that type directly since `shopifyApp()` is able to extract the types from the parameters it's given.
If you need to explicitly set those generics, you'll need to use the `AppConfigParams` type.

<details>
<summary>See an example</summary>

Before:

```ts
import {ShopifyApp} from '@shopify/shopify-app-express';
import {restResources} from '@shopify/shopify-api/rest/admin/2023-10';
import {MemorySessionStorage} from '@shopify/shopify-app-session-storage-memory';

const myVariable: ShopifyApp<typeof restResources, MemorySessionStorage>;
```

After:

```ts
import {ShopifyApp, AppConfigParams} from '@shopify/shopify-app-express';
import {restResources} from '@shopify/shopify-api/rest/admin/2023-10';
import {MemorySessionStorage} from '@shopify/shopify-app-session-storage-memory';

const myVariable: ShopifyApp<
AppConfigParams<typeof restResources, MemorySessionStorage>
>;
```

</details>

### Patch Changes

- a69d6fc: Updating dependency on @shopify/shopify-api to v.8.0.1
- Updated dependencies [f837060]
- Updated dependencies [a69d6fc]
- @shopify/shopify-app-session-storage@2.0.0
- @shopify/shopify-app-session-storage-memory@2.0.0

## 2.2.4

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/shopify-app-express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/shopify-app-express",
"version": "2.2.4",
"version": "3.0.0",
"description": "Shopify Express Middleware - to simplify the building of Shopify Apps with Express",
"repository": {
"type": "git",
Expand Down Expand Up @@ -31,8 +31,8 @@
],
"dependencies": {
"@shopify/shopify-api": "^8.0.1",
"@shopify/shopify-app-session-storage": "^1.1.10",
"@shopify/shopify-app-session-storage-memory": "^1.0.13",
"@shopify/shopify-app-session-storage": "^2.0.0",
"@shopify/shopify-app-session-storage-memory": "^2.0.0",
"cookie-parser": "^1.4.6",
"express": "^4.18.1",
"semver": "^7.5.1",
Expand Down
1 change: 1 addition & 0 deletions packages/shopify-app-express/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export * from './types';
export * from './auth/types';
export * from './middlewares/types';
export * from './webhooks/types';
export type {AppConfigParams} from './config-types';

type DefaultedConfigs<Params extends Partial<ApiConfigParams> | undefined> =
ApiConfigParams & Params;
Expand Down
2 changes: 1 addition & 1 deletion packages/shopify-app-express/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SHOPIFY_EXPRESS_LIBRARY_VERSION = '2.2.4';
export const SHOPIFY_EXPRESS_LIBRARY_VERSION = '3.0.0';
89 changes: 88 additions & 1 deletion packages/shopify-app-remix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,92 @@
# @shopify/shopify-app-remix

## 2.0.0

### Major Changes

- f837060: **Removed support for Node 14**

Node 14 has reached its [EOL](https://endoflife.date/nodejs), and dependencies to this package no longer work on Node 14.
Because of that, we can no longer support that version.

If your app is running on Node 14, you'll need to update to a more recent version before upgrading this package.

This upgrade does not require any code changes.

### Minor Changes

- a1b3393: Added support for `future` flags in the `shopifyApp` function, with a `v3_webhookContext` flag to have `authenticate.webhook` return a standard `admin` context, instead of a different type.

Apps can opt in to the new future at any time, so this is not a breaking change (yet).

<details>
<summary>See an example</summary>

Without the `v3_webhookContext` flag, `graphql` provides a `query` function that takes the query string as the `data` param.
When using variables, `data` needs to be an object containing `query` and `variables`.

```ts
import {json, ActionFunctionArgs} from '@remix-run/node';
import {authenticate} from '../shopify.server';

export async function action({request}: ActionFunctionArgs) {
const {admin} = await authenticate.webhook(request);

const response = await admin?.graphql.query<any>({
data: {
query: `#graphql
mutation populateProduct($input: ProductInput!) {
productCreate(input: $input) {
product {
id
}
}
}`,
variables: {input: {title: 'Product Name'}},
},
});

const productData = response?.body.data;
return json({data: productData.data});
}
```

With the `v3_webhookContext` flag enabled, `graphql` _is_ a function that takes in the query string and an optional settings object, including `variables`.

```ts
import {ActionFunctionArgs} from '@remix-run/node';
import {authenticate} from '../shopify.server';

export async function action({request}: ActionFunctionArgs) {
const {admin} = await authenticate.webhook(request);

const response = await admin?.graphql(
`#graphql
mutation populateProduct($input: ProductInput!) {
productCreate(input: $input) {
product {
id
}
}
}`,
{variables: {input: {title: 'Product Name'}}},
);

const productData = await response.json();
return json({data: productData.data});
}
```

</details>

### Patch Changes

- afb0a7d: Updating Remix dependencies to v2.
- a69d6fc: Updating dependency on @shopify/shopify-api to v.8.0.1
- Updated dependencies [f837060]
- Updated dependencies [a69d6fc]
- @shopify/shopify-app-session-storage@2.0.0

## 1.3.0

### Minor Changes
Expand Down Expand Up @@ -127,7 +214,7 @@

</details>

- 43e7058: Copied `authenticate.public()` to `authenticate.public.checkout()` and marked `authenticate.public()` as deprecated. `authenticate.public()` will continue to work until v2
- 43e7058: Copied `authenticate.public()` to `authenticate.public.checkout()` and marked `authenticate.public()` as deprecated. `authenticate.public()` will continue to work until v3

### Patch Changes

Expand Down
6 changes: 3 additions & 3 deletions packages/shopify-app-remix/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/shopify-app-remix",
"version": "1.3.0",
"version": "2.0.0",
"description": "Shopify Remix - to simplify the building of Shopify Apps with Remix",
"repository": {
"type": "git",
Expand Down Expand Up @@ -54,7 +54,7 @@
"@shopify/generate-docs": "^0.11.1",
"@shopify/polaris": "^11.8.0",
"@shopify/react-testing": "^5.1.3",
"@shopify/shopify-app-session-storage-memory": "^1.0.13",
"@shopify/shopify-app-session-storage-memory": "^2.0.0",
"@types/jest": "^29.5.1",
"@types/jsonwebtoken": "^9.0.2",
"@types/react": "^18.2.18",
Expand All @@ -69,7 +69,7 @@
"dependencies": {
"@remix-run/server-runtime": "^2.0.0",
"@shopify/shopify-api": "^8.0.1",
"@shopify/shopify-app-session-storage": "^1.1.10",
"@shopify/shopify-app-session-storage": "^2.0.0",
"isbot": "^3.6.5",
"semver": "^7.5.0",
"tslib": "^2.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('JWT validation', () => {
expect(config.logger?.log).toHaveBeenCalledWith(
expect.any(Number),
expect.stringContaining(
'authenticate.public() will be deprecated in v2. Use authenticate.public.checkout() instead.',
'authenticate.public() will be deprecated in v3. Use authenticate.public.checkout() instead.',
),
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export function authenticatePublicFactory<
options: AuthenticateCheckoutOptions,
) => {
logger.deprecated(
'2.0.0',
'authenticate.public() will be deprecated in v2. Use authenticate.public.checkout() instead.',
'3.0.0',
'authenticate.public() will be deprecated in v3. Use authenticate.public.checkout() instead.',
);

return authenticateCheckout(request, options);
Expand Down
2 changes: 1 addition & 1 deletion packages/shopify-app-remix/src/server/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SHOPIFY_REMIX_LIBRARY_VERSION = '1.3.0';
export const SHOPIFY_REMIX_LIBRARY_VERSION = '2.0.0';
Loading

0 comments on commit ab35d95

Please sign in to comment.