Skip to content

Commit

Permalink
Merge branch 'main' into liz/store-user-info
Browse files Browse the repository at this point in the history
  • Loading branch information
lizkenyon authored Apr 29, 2024
2 parents cd8c008 + bc44ecb commit 5347a82
Show file tree
Hide file tree
Showing 498 changed files with 7,400 additions and 6,542 deletions.
6 changes: 6 additions & 0 deletions .changeset/cold-eagles-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@shopify/shopify-app-session-storage-drizzle": patch
"@shopify/shopify-app-session-storage-mysql": patch
---

Bump mysql2 from 3.9.2 to 3.9.7
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"updateInternalDependencies": "patch",
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"updateInternalDependents": "always"
"updateInternalDependents": "always",
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
2 changes: 2 additions & 0 deletions .changeset/unlucky-onions-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
rollup.config.js
rollup.config.*.js
rollup.config.cjs
.eslintrc.cjs
node_modules/
Expand Down
58 changes: 48 additions & 10 deletions config/rollup/rollup-utils.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,50 @@
import path from 'path';

import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';
import excludeDependenciesFromBundle from 'rollup-plugin-exclude-dependencies-from-bundle';

export function getPlugins(outDir) {
export function getPlugins({
outDir,
tsconfig,
minify,
replacements,
bundleDependencies = false,
}) {
return [
excludeDependenciesFromBundle({dependencies: true, peerDependencies: true}),
...(bundleDependencies
? []
: [
excludeDependenciesFromBundle({
dependencies: true,
peerDependencies: true,
}),
]),
resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
}),
replace({
preventAssignment: true,
...(replacements ?? {}),
}),
commonjs(),
typescript({
tsconfig: path.resolve('./tsconfig.build.json'),
tsconfig: tsconfig ? tsconfig : './tsconfig.build.json',
outDir,
outputToFilesystem: false,
noEmit: true,
declaration: false,
moduleResolution: 'Bundler',
}),
...(minify === true
? [
terser({
keep_fnames: new RegExp('fetch'),
mangle: {reserved: ['fetch']},
}),
]
: []),
];
}

Expand All @@ -45,19 +66,36 @@ export const cjsConfigs = {
exports: 'named',
};

export function getConfig(pkg, input = 'src/index.ts') {
export function getConfig({
pkg,
minify,
tsconfig,
replacements,
input = 'src/index.ts',
flatOutput = false,
}) {
return [
{
input,
plugins: getPlugins('./dist/esm'),
plugins: getPlugins({
outDir: flatOutput ? './dist' : './dist/esm',
minify,
tsconfig,
replacements,
}),
external: Object.keys(pkg.dependencies),
output: [esmConfigs],
output: [{...esmConfigs, dir: flatOutput ? './dist' : './dist/esm'}],
},
{
input,
plugins: getPlugins('./dist/cjs'),
plugins: getPlugins({
outDir: flatOutput ? './dist' : './dist/cjs',
minify,
tsconfig,
replacements,
}),
external: Object.keys(pkg.dependencies),
output: [cjsConfigs],
output: [{...cjsConfigs, dir: flatOutput ? './dist' : './dist/cjs'}],
},
];
}
7 changes: 7 additions & 0 deletions packages/api-clients/admin-api-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @shopify/admin-api-client

## 0.2.9

### Patch Changes

- Updated dependencies [715a120]
- @shopify/graphql-client@0.10.4

## 0.2.8

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/api-clients/admin-api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/admin-api-client",
"version": "0.2.8",
"version": "0.2.9",
"description": "Shopify Admin API Client - A lightweight JS client to interact with Shopify's Admin API",
"repository": {
"type": "git",
Expand Down Expand Up @@ -30,7 +30,7 @@
},
"scripts": {
"lint": "eslint . --ext .js,.ts",
"build": "yarn run rollup",
"build": "yarn tsc -p ./tsconfig.build.json && yarn run rollup",
"test": "jest",
"test:ci": "yarn test",
"rollup": "rollup -c --bundleConfigAsCjs",
Expand Down Expand Up @@ -60,7 +60,7 @@
"dist/**/*.*"
],
"dependencies": {
"@shopify/graphql-client": "^0.10.3"
"@shopify/graphql-client": "^0.10.4"
},
"devDependencies": {
"jest-environment-jsdom": "^29.5.0",
Expand Down
70 changes: 12 additions & 58 deletions packages/api-clients/admin-api-client/rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -1,64 +1,18 @@
import dts from "rollup-plugin-dts";
import typescript from "@rollup/plugin-typescript";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import terser from "@rollup/plugin-terser";
import replace from "@rollup/plugin-replace";
import dts from 'rollup-plugin-dts';

import * as pkg from "./package.json";
import * as pkg from './package.json';
import {getConfig} from '../../../config/rollup/rollup-utils';

export const mainSrcInput = "src/index.ts";

export function getPlugins({ tsconfig, minify } = {}) {
return [
replace({
preventAssignment: true,
ROLLUP_REPLACE_CLIENT_VERSION: pkg.version,
}),
resolve(),
commonjs(),
typescript({
tsconfig: tsconfig ? tsconfig : "./tsconfig.build.json",
outDir: "./dist/ts",
}),
...(minify === true ? [terser({ keep_fnames: new RegExp("fetch") })] : []),
];
}

const config = [
{
input: mainSrcInput,
plugins: getPlugins(),
output: [
{
dir: "./dist",
format: "es",
sourcemap: true,
preserveModules: true,
preserveModulesRoot: "src",
entryFileNames: "[name].mjs",
},
],
},
export default [
...getConfig({
pkg,
input: 'src/index.ts',
replacements: {ROLLUP_REPLACE_CLIENT_VERSION: pkg.version},
flatOutput: true,
}),
{
input: mainSrcInput,
plugins: getPlugins(),
output: [
{
dir: "./dist",
format: "cjs",
sourcemap: true,
exports: "named",
preserveModules: true,
preserveModulesRoot: "src",
},
],
},
{
input: "./dist/ts/index.d.ts",
output: [{ file: "dist/admin-api-client.d.ts", format: "es" }],
input: './dist/ts/index.d.ts',
output: [{file: 'dist/admin-api-client.d.ts', format: 'es'}],
plugins: [dts.default()],
},
];

export default config;
5 changes: 5 additions & 0 deletions packages/api-clients/admin-api-client/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "dist/ts",
},
"extends": "./tsconfig.json",
"exclude": ["./node_modules", "./src/**/tests/*.ts"]
}
2 changes: 1 addition & 1 deletion packages/api-clients/admin-api-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"declaration": true,
"declarationMap": true,
"target": "ES2022",
"lib": ["ESNext"],
"lib": ["ESNext", "DOM"],
"rootDir": "src",
"baseUrl": "src",
"strict": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/api-clients/api-codegen-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"scripts": {
"lint": "eslint . --ext .js,.ts",
"build": "yarn run rollup",
"build": "yarn tsc -p ./tsconfig.build.json && yarn run rollup",
"test": "jest",
"test:ci": "yarn test",
"rollup": "rollup -c --bundleConfigAsCjs",
Expand Down
62 changes: 7 additions & 55 deletions packages/api-clients/api-codegen-preset/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,17 @@
import dts from 'rollup-plugin-dts';
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import replace from '@rollup/plugin-replace';

import * as pkg from './package.json';
import {getConfig} from '../../../config/rollup/rollup-utils';

export const mainSrcInput = 'src/index.ts';

export function getPlugins({tsconfig, minify} = {}) {
return [
replace({
preventAssignment: true,
}),
resolve(),
commonjs(),
typescript({
tsconfig: tsconfig ? tsconfig : './tsconfig.build.json',
outDir: './dist/ts',
}),
...(minify === true ? [terser({keep_fnames: new RegExp('fetch')})] : []),
];
}

const config = [
{
input: mainSrcInput,
plugins: getPlugins(),
external: Object.keys(pkg.dependencies),
output: [
{
dir: './dist',
format: 'es',
sourcemap: true,
preserveModules: true,
preserveModulesRoot: 'src',
entryFileNames: '[name].mjs',
},
],
},
{
input: mainSrcInput,
plugins: getPlugins(),
external: Object.keys(pkg.dependencies),
output: [
{
dir: './dist',
format: 'cjs',
sourcemap: true,
exports: 'named',
preserveModules: true,
preserveModulesRoot: 'src',
},
],
},
export default [
...getConfig({
pkg,
input: 'src/index.ts',
flatOutput: true,
}),
{
input: './dist/ts/index.d.ts',
output: [{file: 'dist/index.d.ts', format: 'es'}],
plugins: [dts.default()],
},
];

export default config;
7 changes: 7 additions & 0 deletions packages/api-clients/api-codegen-preset/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"moduleResolution": "Bundler",
"module": "Preserve",
"outDir": "dist/ts",
},
"extends": "./tsconfig.json",
"exclude": ["./node_modules", "./src/**/tests/*.ts"]
}
6 changes: 6 additions & 0 deletions packages/api-clients/graphql-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @shopify/graphql-client

## 0.10.4

### Patch Changes

- 715a120: Fixed the minified build process to not mangle the `fetch` function, which led to requests failing in the final package.

## 0.10.3

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/api-clients/graphql-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/graphql-client",
"version": "0.10.3",
"version": "0.10.4",
"description": "Shopify GraphQL Client - A lightweight generic GraphQL JS client to interact with Shopify GraphQL APIs",
"repository": {
"type": "git",
Expand Down Expand Up @@ -31,7 +31,7 @@
},
"scripts": {
"lint": "eslint . --ext .js,.ts",
"build": "yarn run rollup",
"build": "yarn tsc -p ./tsconfig.build.json && yarn run rollup",
"test": "jest",
"test:ci": "yarn test",
"rollup": "rollup -c --bundleConfigAsCjs",
Expand Down
Loading

0 comments on commit 5347a82

Please sign in to comment.