This commit is contained in:
Lukasz Ostrowski 2023-04-14 09:53:16 +02:00
parent 458835c731
commit 8cb9cbfbae
20 changed files with 21150 additions and 72905 deletions

View file

@ -0,0 +1,5 @@
---
"e2e-toolkit": major
---
Introduce e2e-toolkit package (cli) with a single feature - removing all apps from provided env

View file

@ -10,10 +10,6 @@ extensions:
plugins: plugins:
- typescript - typescript
- typescript-operations - typescript-operations
- urql-introspection
- typescript-urql:
documentVariablePrefix: "Untyped"
fragmentVariablePrefix: "Untyped"
- typed-document-node - typed-document-node
generated/schema.graphql: generated/schema.graphql:
plugins: plugins:

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,12 @@
{ {
"name": "saleor-app-template", "name": "e2e-toolkit",
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "pnpm generate && tsup src/cli.ts --watch", "dev": "pnpm generate && tsup src/cli.ts --watch",
"build": "tsup src/cli.ts", "build": "pnpm generate && tsup src/cli.ts",
"start": "node dist/cli.ts",
"lint": "next lint", "lint": "next lint",
"fetch-schema": "curl https://raw.githubusercontent.com/saleor/saleor/${npm_package_saleor_schemaVersion}/saleor/graphql/schema.graphql > graphql/schema.graphql", "fetch-schema": "curl https://raw.githubusercontent.com/saleor/saleor/${npm_package_saleor_schemaVersion}/saleor/graphql/schema.graphql > graphql/schema.graphql",
"generate": "graphql-codegen", "generate": "graphql-codegen",
@ -22,11 +23,9 @@
"graphql-tag": "^2.12.6", "graphql-tag": "^2.12.6",
"jsdom": "^20.0.3", "jsdom": "^20.0.3",
"tsup": "^6.7.0", "tsup": "^6.7.0",
"urql": "^3.0.3",
"vite": "^4.0.4", "vite": "^4.0.4",
"vitest": "^0.27.1", "vitest": "^0.27.1",
"graphql-request": "^6.0.0", "graphql-request": "^6.0.0"
"node-fetch": "^3.3.1"
}, },
"devDependencies": { "devDependencies": {
"@graphql-codegen/cli": "2.13.3", "@graphql-codegen/cli": "2.13.3",
@ -34,11 +33,7 @@
"@graphql-codegen/typed-document-node": "^2.3.3", "@graphql-codegen/typed-document-node": "^2.3.3",
"@graphql-codegen/typescript": "2.7.3", "@graphql-codegen/typescript": "2.7.3",
"@graphql-codegen/typescript-operations": "2.5.3", "@graphql-codegen/typescript-operations": "2.5.3",
"@graphql-codegen/typescript-urql": "^3.7.0",
"@graphql-codegen/urql-introspection": "2.2.1",
"@graphql-typed-document-node/core": "^3.1.1", "@graphql-typed-document-node/core": "^3.1.1",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.1",
"@types/node": "^18.11.18", "@types/node": "^18.11.18",
"eslint": "8.31.0", "eslint": "8.31.0",
"eslint-config-saleor": "workspace:*", "eslint-config-saleor": "workspace:*",

View file

@ -1,5 +1,5 @@
import { Command } from "commander"; import { Command } from "commander";
import { request, gql, GraphQLClient } from "graphql-request"; import { GraphQLClient } from "graphql-request";
import { import {
AuthorizeDocument, AuthorizeDocument,
FetchAllAppsDocument, FetchAllAppsDocument,
@ -19,12 +19,8 @@ program
.requiredOption("--email <type>", "Email for user with MANAGE_APPS permission") .requiredOption("--email <type>", "Email for user with MANAGE_APPS permission")
.requiredOption("--password <type>", "Password for the user") .requiredOption("--password <type>", "Password for the user")
.requiredOption("--saleor <type>", "saleor api URL ending with /graphql/") .requiredOption("--saleor <type>", "saleor api URL ending with /graphql/")
.action(async (fields, options) => { .action(async (fields: { email: string; password: string; saleor: string }) => {
const { email, password, saleor } = fields as { const { email, password, saleor } = fields;
email: string;
password: string;
saleor: string;
};
const client = new GraphQLClient(saleor); const client = new GraphQLClient(saleor);

File diff suppressed because it is too large Load diff

View file

@ -1612,7 +1612,7 @@ importers:
specifier: 4.8.4 specifier: 4.8.4
version: 4.8.4 version: 4.8.4
packages/e2e: packages/e2e-toolkit:
dependencies: dependencies:
'@urql/exchange-auth': '@urql/exchange-auth':
specifier: ^1.0.0 specifier: ^1.0.0
@ -1635,15 +1635,9 @@ importers:
jsdom: jsdom:
specifier: ^20.0.3 specifier: ^20.0.3
version: 20.0.3 version: 20.0.3
node-fetch:
specifier: ^3.3.1
version: 3.3.1
tsup: tsup:
specifier: ^6.7.0 specifier: ^6.7.0
version: 6.7.0(typescript@4.9.4) version: 6.7.0(typescript@4.9.4)
urql:
specifier: ^3.0.3
version: 3.0.3(graphql@16.6.0)(react@18.2.0)
vite: vite:
specifier: ^4.0.4 specifier: ^4.0.4
version: 4.1.4(@types/node@18.13.0) version: 4.1.4(@types/node@18.13.0)
@ -1666,21 +1660,9 @@ importers:
'@graphql-codegen/typescript-operations': '@graphql-codegen/typescript-operations':
specifier: 2.5.3 specifier: 2.5.3
version: 2.5.3(graphql@16.6.0) version: 2.5.3(graphql@16.6.0)
'@graphql-codegen/typescript-urql':
specifier: ^3.7.0
version: 3.7.3(graphql-tag@2.12.6)(graphql@16.6.0)
'@graphql-codegen/urql-introspection':
specifier: 2.2.1
version: 2.2.1(graphql@16.6.0)
'@graphql-typed-document-node/core': '@graphql-typed-document-node/core':
specifier: ^3.1.1 specifier: ^3.1.1
version: 3.2.0(graphql@16.6.0) version: 3.2.0(graphql@16.6.0)
'@testing-library/react':
specifier: ^13.4.0
version: 13.4.0(react-dom@18.2.0)(react@18.2.0)
'@testing-library/react-hooks':
specifier: ^8.0.1
version: 8.0.1(@types/react@18.0.27)(react-dom@18.2.0)(react@18.2.0)
'@types/node': '@types/node':
specifier: ^18.11.18 specifier: ^18.11.18
version: 18.13.0 version: 18.13.0
@ -1935,12 +1917,6 @@ packages:
- encoding - encoding
dev: true dev: true
/@babel/code-frame@7.18.6:
resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/highlight': 7.18.6
/@babel/code-frame@7.21.4: /@babel/code-frame@7.21.4:
resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==} resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
@ -1957,14 +1933,14 @@ packages:
dependencies: dependencies:
'@ampproject/remapping': 2.2.0 '@ampproject/remapping': 2.2.0
'@babel/code-frame': 7.21.4 '@babel/code-frame': 7.21.4
'@babel/generator': 7.20.14 '@babel/generator': 7.21.4
'@babel/helper-compilation-targets': 7.20.7(@babel/core@7.20.12) '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.20.12)
'@babel/helper-module-transforms': 7.20.11 '@babel/helper-module-transforms': 7.20.11
'@babel/helpers': 7.20.13 '@babel/helpers': 7.20.13
'@babel/parser': 7.20.15 '@babel/parser': 7.21.4
'@babel/template': 7.20.7 '@babel/template': 7.20.7
'@babel/traverse': 7.20.13 '@babel/traverse': 7.20.13
'@babel/types': 7.20.7 '@babel/types': 7.21.4
convert-source-map: 1.9.0 convert-source-map: 1.9.0
debug: 4.3.4 debug: 4.3.4
gensync: 1.0.0-beta.2 gensync: 1.0.0-beta.2
@ -1999,9 +1975,10 @@ packages:
resolution: {integrity: sha512-AEmuXHdcD3A52HHXxaTmYlb8q/xMEhoRP67B3T4Oq7lbmSoqroMZzjnGj3+i1io3pdnF8iBYVu4Ilj+c4hBxYg==} resolution: {integrity: sha512-AEmuXHdcD3A52HHXxaTmYlb8q/xMEhoRP67B3T4Oq7lbmSoqroMZzjnGj3+i1io3pdnF8iBYVu4Ilj+c4hBxYg==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
dependencies: dependencies:
'@babel/types': 7.20.7 '@babel/types': 7.21.4
'@jridgewell/gen-mapping': 0.3.2 '@jridgewell/gen-mapping': 0.3.3
jsesc: 2.5.2 jsesc: 2.5.2
dev: true
/@babel/generator@7.21.4: /@babel/generator@7.21.4:
resolution: {integrity: sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==} resolution: {integrity: sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==}
@ -2208,13 +2185,6 @@ packages:
chalk: 2.4.2 chalk: 2.4.2
js-tokens: 4.0.0 js-tokens: 4.0.0
/@babel/parser@7.20.15:
resolution: {integrity: sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==}
engines: {node: '>=6.0.0'}
hasBin: true
dependencies:
'@babel/types': 7.21.4
/@babel/parser@7.21.4: /@babel/parser@7.21.4:
resolution: {integrity: sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==} resolution: {integrity: sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==}
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
@ -2550,9 +2520,9 @@ packages:
resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
dependencies: dependencies:
'@babel/code-frame': 7.18.6 '@babel/code-frame': 7.21.4
'@babel/parser': 7.20.15 '@babel/parser': 7.21.4
'@babel/types': 7.20.7 '@babel/types': 7.21.4
/@babel/traverse@7.20.13: /@babel/traverse@7.20.13:
resolution: {integrity: sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==} resolution: {integrity: sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==}
@ -2595,6 +2565,7 @@ packages:
'@babel/helper-string-parser': 7.19.4 '@babel/helper-string-parser': 7.19.4
'@babel/helper-validator-identifier': 7.19.1 '@babel/helper-validator-identifier': 7.19.1
to-fast-properties: 2.0.0 to-fast-properties: 2.0.0
dev: true
/@babel/types@7.21.4: /@babel/types@7.21.4:
resolution: {integrity: sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==} resolution: {integrity: sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==}
@ -4494,14 +4465,6 @@ packages:
'@jridgewell/set-array': 1.1.2 '@jridgewell/set-array': 1.1.2
'@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/sourcemap-codec': 1.4.15
/@jridgewell/gen-mapping@0.3.2:
resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==}
engines: {node: '>=6.0.0'}
dependencies:
'@jridgewell/set-array': 1.1.2
'@jridgewell/sourcemap-codec': 1.4.15
'@jridgewell/trace-mapping': 0.3.18
/@jridgewell/gen-mapping@0.3.3: /@jridgewell/gen-mapping@0.3.3:
resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
@ -6523,7 +6486,7 @@ packages:
resolution: {integrity: sha512-d9ULIT+a4EXLX3UU8FBjauG9NnsZHkHztXoIcTsOKoOw030fyjheN9svkTULjJxtYag9DZz5Jz5qkWZDPxTFwA==} resolution: {integrity: sha512-d9ULIT+a4EXLX3UU8FBjauG9NnsZHkHztXoIcTsOKoOw030fyjheN9svkTULjJxtYag9DZz5Jz5qkWZDPxTFwA==}
engines: {node: '>=12'} engines: {node: '>=12'}
dependencies: dependencies:
'@babel/code-frame': 7.18.6 '@babel/code-frame': 7.21.4
'@babel/runtime': 7.20.13 '@babel/runtime': 7.20.13
'@types/aria-query': 5.0.1 '@types/aria-query': 5.0.1
aria-query: 5.1.3 aria-query: 5.1.3
@ -13616,15 +13579,6 @@ packages:
formdata-polyfill: 4.0.10 formdata-polyfill: 4.0.10
dev: false dev: false
/node-fetch@3.3.1:
resolution: {integrity: sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
data-uri-to-buffer: 4.0.1
fetch-blob: 3.2.0
formdata-polyfill: 4.0.10
dev: false
/node-gyp-build@4.6.0: /node-gyp-build@4.6.0:
resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==} resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==}
hasBin: true hasBin: true
@ -15781,7 +15735,7 @@ packages:
engines: {node: '>=8'} engines: {node: '>=8'}
hasBin: true hasBin: true
dependencies: dependencies:
'@jridgewell/gen-mapping': 0.3.2 '@jridgewell/gen-mapping': 0.3.3
commander: 4.1.1 commander: 4.1.1
glob: 7.1.6 glob: 7.1.6
lines-and-columns: 1.2.4 lines-and-columns: 1.2.4