|
|
@@ -8,13 +8,23 @@ import { ADMIN_API_PATH, API_PORT, SHOP_API_PATH } from '../../packages/common/s
|
|
|
|
|
|
import { downloadIntrospectionSchema } from './download-introspection-schema';
|
|
|
|
|
|
-const CLIENT_QUERY_FILES = path.join(__dirname, '../../packages/admin-ui/src/lib/core/src/data/definitions/**/*.ts');
|
|
|
-const E2E_ADMIN_QUERY_FILES = path.join(__dirname, '../../packages/core/e2e/**/!(import.e2e-spec|plugin.e2e-spec|shop-definitions|custom-fields.e2e-spec|list-query-builder.e2e-spec).ts');
|
|
|
-const E2E_SHOP_QUERY_FILES = [
|
|
|
- path.join(__dirname, '../../packages/core/e2e/graphql/shop-definitions.ts'),
|
|
|
-];
|
|
|
-const E2E_ELASTICSEARCH_PLUGIN_QUERY_FILES = path.join(__dirname, '../../packages/elasticsearch-plugin/e2e/**/*.ts');
|
|
|
-const E2E_ASSET_SERVER_PLUGIN_QUERY_FILES = path.join(__dirname, '../../packages/asset-server-plugin/e2e/**/*.ts');
|
|
|
+const CLIENT_QUERY_FILES = path.join(
|
|
|
+ __dirname,
|
|
|
+ '../../packages/admin-ui/src/lib/core/src/data/definitions/**/*.ts',
|
|
|
+);
|
|
|
+const E2E_ADMIN_QUERY_FILES = path.join(
|
|
|
+ __dirname,
|
|
|
+ '../../packages/core/e2e/**/!(import.e2e-spec|plugin.e2e-spec|shop-definitions|custom-fields.e2e-spec|price-calculation-strategy.e2e-spec|list-query-builder.e2e-spec).ts',
|
|
|
+);
|
|
|
+const E2E_SHOP_QUERY_FILES = [path.join(__dirname, '../../packages/core/e2e/graphql/shop-definitions.ts')];
|
|
|
+const E2E_ELASTICSEARCH_PLUGIN_QUERY_FILES = path.join(
|
|
|
+ __dirname,
|
|
|
+ '../../packages/elasticsearch-plugin/e2e/**/*.ts',
|
|
|
+);
|
|
|
+const E2E_ASSET_SERVER_PLUGIN_QUERY_FILES = path.join(
|
|
|
+ __dirname,
|
|
|
+ '../../packages/asset-server-plugin/e2e/**/*.ts',
|
|
|
+);
|
|
|
const ADMIN_SCHEMA_OUTPUT_FILE = path.join(__dirname, '../../schema-admin.json');
|
|
|
const SHOP_SCHEMA_OUTPUT_FILE = path.join(__dirname, '../../schema-shop.json');
|
|
|
|
|
|
@@ -40,15 +50,8 @@ Promise.all([
|
|
|
},
|
|
|
strict: true,
|
|
|
};
|
|
|
- const commonPlugins = [
|
|
|
- { add: '// tslint:disable' },
|
|
|
- 'typescript',
|
|
|
- ];
|
|
|
- const clientPlugins = [
|
|
|
- ...commonPlugins,
|
|
|
- 'typescript-operations',
|
|
|
- 'typescript-compatibility',
|
|
|
- ];
|
|
|
+ const commonPlugins = [{ add: '// tslint:disable' }, 'typescript'];
|
|
|
+ const clientPlugins = [...commonPlugins, 'typescript-operations', 'typescript-compatibility'];
|
|
|
|
|
|
return generate({
|
|
|
overwrite: true,
|
|
|
@@ -65,25 +68,37 @@ Promise.all([
|
|
|
plugins: clientPlugins,
|
|
|
config,
|
|
|
},
|
|
|
- [path.join(__dirname, '../../packages/elasticsearch-plugin/e2e/graphql/generated-e2e-elasticsearch-plugin-types.ts')]: {
|
|
|
+ [path.join(
|
|
|
+ __dirname,
|
|
|
+ '../../packages/elasticsearch-plugin/e2e/graphql/generated-e2e-elasticsearch-plugin-types.ts',
|
|
|
+ )]: {
|
|
|
schema: [ADMIN_SCHEMA_OUTPUT_FILE],
|
|
|
documents: E2E_ELASTICSEARCH_PLUGIN_QUERY_FILES,
|
|
|
plugins: clientPlugins,
|
|
|
config,
|
|
|
},
|
|
|
- [path.join(__dirname, '../../packages/asset-server-plugin/e2e/graphql/generated-e2e-asset-server-plugin-types.ts')]: {
|
|
|
+ [path.join(
|
|
|
+ __dirname,
|
|
|
+ '../../packages/asset-server-plugin/e2e/graphql/generated-e2e-asset-server-plugin-types.ts',
|
|
|
+ )]: {
|
|
|
schema: [ADMIN_SCHEMA_OUTPUT_FILE],
|
|
|
documents: E2E_ASSET_SERVER_PLUGIN_QUERY_FILES,
|
|
|
plugins: clientPlugins,
|
|
|
config,
|
|
|
},
|
|
|
- [path.join(__dirname, '../../packages/admin-ui/src/lib/core/src/common/generated-types.ts')]: {
|
|
|
+ [path.join(
|
|
|
+ __dirname,
|
|
|
+ '../../packages/admin-ui/src/lib/core/src/common/generated-types.ts',
|
|
|
+ )]: {
|
|
|
schema: [ADMIN_SCHEMA_OUTPUT_FILE, path.join(__dirname, 'client-schema.ts')],
|
|
|
documents: CLIENT_QUERY_FILES,
|
|
|
plugins: clientPlugins,
|
|
|
config,
|
|
|
},
|
|
|
- [path.join(__dirname, '../../packages/admin-ui/src/lib/core/src/common/introspection-result.ts')]: {
|
|
|
+ [path.join(
|
|
|
+ __dirname,
|
|
|
+ '../../packages/admin-ui/src/lib/core/src/common/introspection-result.ts',
|
|
|
+ )]: {
|
|
|
schema: [ADMIN_SCHEMA_OUTPUT_FILE, path.join(__dirname, 'client-schema.ts')],
|
|
|
documents: CLIENT_QUERY_FILES,
|
|
|
plugins: [{ add: '// tslint:disable' }, 'fragment-matcher'],
|
|
|
@@ -103,10 +118,10 @@ Promise.all([
|
|
|
});
|
|
|
})
|
|
|
.then(
|
|
|
- result => {
|
|
|
+ (result) => {
|
|
|
process.exit(0);
|
|
|
},
|
|
|
- err => {
|
|
|
+ (err) => {
|
|
|
console.error(err);
|
|
|
process.exit(1);
|
|
|
},
|