Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Shopify/shopify-api-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0be0055accd97af0762a4bdea4b7cf8aedbd6207
Choose a base ref
..
head repository: Shopify/shopify-api-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fc67b1b84b749c95eeaf7ca97f8bd82efcf91bc9
Choose a head ref
Showing 631 changed files with 44,846 additions and 7,876 deletions.
5 changes: 0 additions & 5 deletions .changeset/famous-rivers-invite.md

This file was deleted.

8 changes: 8 additions & 0 deletions .changeset/hungry-humans-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@shopify/storefront-api-client": patch
"@shopify/admin-api-client": patch
"@shopify/graphql-client": patch
"@shopify/shopify-api": patch
---

Updated global fetch types to more closely match reality
2 changes: 2 additions & 0 deletions .changeset/little-suits-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions .changeset/many-brooms-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopify/shopify-api": minor
---

Export GraphqlClient class from types
2 changes: 2 additions & 0 deletions .changeset/polite-bugs-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/rare-carrots-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
3 changes: 1 addition & 2 deletions packages/graphql-client/.eslintignore → .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
rollup.config.js
rollup-common.js
rollup-umd.config.js
rollup.config.cjs
.eslintrc.cjs
node_modules/
dist/
21 changes: 17 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
const { GlobSync } = require("glob");

const packageDir = ["."];
if (process.cwd().includes("shopify-api-js/packages")) {
packageDir.push(__dirname);
} else {
const glob = new GlobSync(`${__dirname}/packages/*`);
glob.found.forEach((path) =>
packageDir.push(path.replace(/^.*\/shopify-api-js\//, ""))
);
}

module.exports = {
env: {
browser: false,
es2021: true,
},
extends: ['plugin:@shopify/typescript', 'plugin:@shopify/prettier'],
ignorePatterns: ['dist/'],
extends: ["plugin:@shopify/typescript", "plugin:@shopify/prettier"],
ignorePatterns: ["dist/", "node_modules/"],
rules: {
'no-console': 0,
'@typescript-eslint/naming-convention': 0,
"no-console": 0,
"@typescript-eslint/naming-convention": 0,
"import/no-extraneous-dependencies": ["error", { packageDir }],
},
};
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -12,8 +12,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
# TODO Remove the --ignore-engines flag when we drop support for Node 16
- name: Install
run: yarn install
run: yarn install --ignore-engines
- name: Build
run: yarn build
- name: Lint
run: yarn lint
- name: Test
3 changes: 2 additions & 1 deletion .github/workflows/main-release.yml
Original file line number Diff line number Diff line change
@@ -21,8 +21,9 @@ jobs:
node-version: 16.x
cache: 'yarn'

# TODO Remove the --ignore-engines flag when we drop support for Node 16
- name: Install dependencies
run: yarn --frozen-lockfile
run: yarn --frozen-lockfile --ignore-engines

- name: Create release Pull Request or publish to NPM
id: changesets
3 changes: 2 additions & 1 deletion .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
@@ -21,8 +21,9 @@ jobs:
node-version: 16.x
cache: 'yarn'

# TODO Remove the --ignore-engines flag when we drop support for Node 16
- name: Install dependencies
run: yarn --frozen-lockfile
run: yarn --frozen-lockfile --ignore-engines

- name: Create release candidate PR or publish to NPM
id: changesets
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"cSpell.words": ["isbot"]
"cSpell.words": [
"isbot"
]
}
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
# `@shopify/shopify-api-js`

This mono-repo is a collection of Shopify's JavaScript API client libraries.
This mono-repo is a collection of Shopify's JavaScript API client libraries and utilities.

### [`@shopify/shopify-api`](./packages/shopify-api)
## [`@shopify/shopify-api`](./packages/shopify-api)

This library provides support for the backends of TypeScript/JavaScript Shopify apps to access the Shopify Admin API, by making it easier to perform the following actions:
A library supporting Shopify apps to access Shopify's APIs, by making it easier to perform the following actions:

- Creating online or offline access tokens for the Admin API via OAuth
- Making requests to the REST API
- Making requests to the GraphQL API
- Making requests to the Admin API (REST or GraphQL) and Storefront API (GraphQL).
- Register/process webhooks

Once your app has access to the Admin API, you can also access the Shopify Storefront API to run GraphQL queries using the unauthenticated_* access scopes.
For use on the server.

This library can be used in any application that runs on one of the supported runtimes. It doesn't rely on any specific framework, so you can include it alongside your preferred stack and only use the features that you need to build your app.
## [`@shopify/storefront-api-client`](./packages/storefront-api-client)

A library to interact with Shopify's GraphQL Storefront API. For use on the client or server.

## [`@shopify/admin-api-client`](./packages/admin-api-client)

A library to interact with Shopify's GraphQL and REST Admin APIs. For use on the server.

## [`@shopify/graphql-client`](./packages/graphql-client)

A client to interact with any of Shopify's GraphQL APIs.

## [`@shopify/api-codegen-preset`](./packages/api-codegen-preset)

Enables JavaScript / TypeScript apps to use a `#graphql` tag to parse queries with `graphql-codegen`.
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ See the sections below for specific details related to the steps outlined above.
git checkout changeset-release/main
```

1. Update the version string in the `lib/version.ts` file to match the version in the `package.json` file in this branch.
1. Update the version string in the `packages/shopify-api/lib/version.ts` file to match the version in the `package.json` file in this branch.

1. If needed, edit/remove any of the comments in the `CHANGELOG.md` files and commit them to the `changeset-release/main` branch.

@@ -94,7 +94,7 @@ For significant API changes that could result in significant refactoring on the
git checkout changeset-release/release-candidate
```

1. Update the version string in the `lib/version.ts` file to match the version in the `package.json` file. Make sure to add an `-rc.X` to the version, like so:
1. Update the version string in the `packages/shopify-api/lib/version.ts` file to match the version in the `package.json` file. Make sure to add an `-rc.X` to the version, like so:

```text
7.0.0-rc.1
11 changes: 0 additions & 11 deletions lib/flow/index.ts

This file was deleted.

20 changes: 0 additions & 20 deletions lib/flow/types.ts

This file was deleted.

74 changes: 0 additions & 74 deletions lib/flow/validate.ts

This file was deleted.

39 changes: 32 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"build": "turbo build",
"dev": "turbo dev --no-cache --continue",
"lint": "turbo lint",
"clean": "turbo clean && rm -rf node_modules",
"clean": "turbo clean",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"changeset": "changeset",
"version-packages": "changeset version",
@@ -16,16 +16,41 @@
"test:ci": "turbo run test:ci --parallel"
},
"devDependencies": {
"@babel/core": "^7.23.9",
"@babel/plugin-transform-async-to-generator": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.23.9",
"@babel/preset-env": "^7.23.8",
"@babel/preset-typescript": "^7.23.3",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.22.0",
"@shopify/eslint-plugin": "^42.0.0",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-eslint": "^9.0.3",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.1.6",
"@shopify/babel-preset": "^25.0.0",
"@shopify/eslint-plugin": "^44.0.0",
"@shopify/prettier-config": "^1.1.2",
"eslint": "^7.32.0",
"@shopify/typescript-configs": "^5.1.0",
"@types/jest": "^29.5.0",
"@types/regenerator-runtime": "^0.13.5",
"@typescript-eslint/parser": "^6.19.1",
"babel-jest": "^29.5.0",
"eslint": "^8.56.0",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"jest-runner-eslint": "^2.1.2",
"prettier": "^2.5.1",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"turbo": "^1.9.3"
"prettier": "^3.1.0",
"regenerator-runtime": "^0.14.1",
"rollup": "^3.19.1",
"rollup-plugin-dts": "^6.1.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tslib": "^2.5.0",
"turbo": "^1.11.2",
"typescript": "^5.3.2"
},
"dependencies": {},
"workspaces": [
18 changes: 18 additions & 0 deletions packages/admin-api-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

node_modules/
dist/

package-lock.json
.vscode/
.DS_Store
.rollup.cache/

# ignore any locally packed packages
*.tgz
!*.d.ts
Loading