Родитель
4059362fbc
Коммит
d3baa5116d
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Added proper mjs builds (bump for main release)",
|
||||
"packageName": "@graphitation/apollo-mock-client",
|
||||
"email": "mnovikov@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Added proper mjs builds (bump for main release)",
|
||||
"packageName": "@graphitation/apollo-react-relay-duct-tape",
|
||||
"email": "mnovikov@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Added proper mjs builds (bump for main release)",
|
||||
"packageName": "@graphitation/graphql-eslint-rules",
|
||||
"email": "mnovikov@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Added proper mjs builds (bump for main release)",
|
||||
"packageName": "@graphitation/graphql-js-operation-payload-generator",
|
||||
"email": "mnovikov@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Added proper mjs builds (bump for main release)",
|
||||
"packageName": "@graphitation/graphql-js-tag",
|
||||
"email": "mnovikov@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Added proper mjs builds (bump for main release)",
|
||||
"packageName": "@graphitation/supermassive",
|
||||
"email": "mnovikov@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Added proper mjs builds (bump for main release)",
|
||||
"packageName": "@graphitation/ts-transform-graphql-js-tag",
|
||||
"email": "mnovikov@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Added proper mjs builds (bump for main release)",
|
||||
"packageName": "relay-compiler-language-graphitation",
|
||||
"email": "mnovikov@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
node_modules/
|
||||
dist/
|
||||
yarn-error.log
|
||||
stats/
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"tabWidth": 2,
|
||||
"useTabs": false
|
||||
}
|
Двоичные данные
examples/supermassive-todomvc/graphitation-supermassive-0.2.0-test.1222021.tgz
Normal file
Двоичные данные
examples/supermassive-todomvc/graphitation-supermassive-0.2.0-test.1222021.tgz
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "supermassive-todomvc",
|
||||
"main": "index.js",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"build": "webpack --mode production --config webpack.config.ts",
|
||||
"start": "webpack serve --progress --color --mode=development --config webpack.config.ts "
|
||||
},
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.4.16",
|
||||
"@babel/runtime": "^7.12.0",
|
||||
"@graphitation/apollo-react-relay-duct-tape": "^0.5.0-store-observation.6",
|
||||
"@graphitation/graphql-js-tag": "^0.5.4",
|
||||
"@graphitation/supermassive": "../graphitation-supermassive-0.3.0-jakub.1.tgz",
|
||||
"@graphitation/ts-transform-graphql-js-tag": "^0.2.2",
|
||||
"@types/graphql": "^14.5.0",
|
||||
"@types/lodash": "^4.14.175",
|
||||
"graphql": "^15.6.1",
|
||||
"graphql-tools": "^8.2.0",
|
||||
"html-webpack-plugin": "^5.3.2",
|
||||
"lodash": "^4.17.21",
|
||||
"prettier": "^2.4.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"ts-loader": "^9.0.0",
|
||||
"ts-node": "^10.4.0",
|
||||
"typescript": "^4.4.3",
|
||||
"uuid": "^8.3.2",
|
||||
"webpack": "^5.0.0",
|
||||
"webpack-cli": "^4.6.0",
|
||||
"webpack-dev-server": "^3.1.14",
|
||||
"webpack-graphql-loader": "^1.0.2",
|
||||
"zen-observable": "^0.8.15"
|
||||
},
|
||||
"resolutions": {
|
||||
"graphql": "^15.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@graphql-codegen/cli": "^2.2.2",
|
||||
"@graphql-codegen/import-types-preset": "^2.1.7",
|
||||
"@graphql-codegen/typescript": "^2.3.0",
|
||||
"@statoscope/webpack-plugin": "^5.18.0",
|
||||
"@types/react": "^17.0.30",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/uuid": "^8.3.1",
|
||||
"graphql-let": "^0.18.5"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
import {
|
||||
ApolloClient,
|
||||
InMemoryCache,
|
||||
from,
|
||||
ApolloProvider,
|
||||
} from "@apollo/client";
|
||||
import React from "react";
|
||||
|
||||
import { onError } from "@apollo/client/link/error";
|
||||
import TodoList from "./components/TodoList";
|
||||
import { asyncSplit } from "./schema/asyncSplit";
|
||||
|
||||
// Log any GraphQL errors or network error that occurred
|
||||
const errorLink = onError(({ graphQLErrors, networkError }) => {
|
||||
if (graphQLErrors)
|
||||
graphQLErrors.forEach((error) => {
|
||||
const { message, locations, path } = error;
|
||||
console.log(
|
||||
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
|
||||
);
|
||||
console.error(error);
|
||||
});
|
||||
if (networkError) {
|
||||
console.log(`[Network error]: ${networkError}`);
|
||||
console.error(networkError);
|
||||
}
|
||||
});
|
||||
|
||||
const client = new ApolloClient({
|
||||
cache: new InMemoryCache(),
|
||||
link: from([
|
||||
errorLink,
|
||||
asyncSplit(
|
||||
() => true,
|
||||
async () => {
|
||||
const { supermassiveSchemaLink } = await import(
|
||||
/* webpackChunkName: "supermassiveLink" */
|
||||
"./schema/productionLink"
|
||||
);
|
||||
return supermassiveSchemaLink;
|
||||
},
|
||||
async () => {
|
||||
const { executableSchemaLink } = await import(
|
||||
/* webpackChunkName: "executableLink" */
|
||||
"./schema/link"
|
||||
);
|
||||
return executableSchemaLink;
|
||||
}
|
||||
),
|
||||
]),
|
||||
});
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<ApolloProvider client={client}>
|
||||
<TodoList />
|
||||
</ApolloProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
|
@ -0,0 +1,24 @@
|
|||
import React from "react";
|
||||
|
||||
import { useFragment } from "@graphitation/apollo-react-relay-duct-tape";
|
||||
import { graphql } from "@graphitation/graphql-js-tag";
|
||||
|
||||
export const TodoFragment = graphql`
|
||||
fragment TodoFragment on Todo {
|
||||
id
|
||||
text
|
||||
isCompleted
|
||||
}
|
||||
`;
|
||||
|
||||
const Todo = ({ todo: todoRef }: { todo: any }) => {
|
||||
const todo = useFragment(TodoFragment, todoRef);
|
||||
return (
|
||||
<>
|
||||
<span>{todo.text}</span>
|
||||
<input type="checkbox" value={todo.isCompleted} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Todo;
|
|
@ -0,0 +1,34 @@
|
|||
import React from "react";
|
||||
|
||||
import { useLazyLoadQuery } from "@graphitation/apollo-react-relay-duct-tape";
|
||||
import { graphql } from "@graphitation/graphql-js-tag";
|
||||
import Todo, { TodoFragment } from "./Todo";
|
||||
|
||||
const TodoListQuery = graphql`
|
||||
query TodoListQuery {
|
||||
allTodos {
|
||||
id
|
||||
...TodoFragment
|
||||
}
|
||||
}
|
||||
|
||||
${TodoFragment}
|
||||
`;
|
||||
|
||||
const TodoList = () => {
|
||||
const { data } = useLazyLoadQuery(TodoListQuery, {});
|
||||
return (
|
||||
<>
|
||||
<h1>Todo List</h1>
|
||||
<ul>
|
||||
{(data as any)?.allTodos?.map((todo: any) => (
|
||||
<li key={todo.id}>
|
||||
<Todo todo={todo} />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default TodoList;
|
|
@ -0,0 +1,6 @@
|
|||
declare module "*.graphql" {
|
||||
import { DocumentNode } from "graphql";
|
||||
const Schema: DocumentNode;
|
||||
|
||||
export = Schema;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { render } from 'react-dom'
|
||||
|
||||
import App from './App';
|
||||
|
||||
render(<App />, document.body);
|
|
@ -0,0 +1,53 @@
|
|||
import { GraphQLList, GraphQLNonNull, GraphQLID, GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLInputObjectType } from "graphql";
|
||||
const Query = {};
|
||||
const Mutation = {};
|
||||
const Todo = {};
|
||||
const Failure = { __resolveType: undefined };
|
||||
const CreateTodoResult = { __resolveType: undefined };
|
||||
const CreateTodoInput = new GraphQLInputObjectType({
|
||||
name: "CreateTodoInput",
|
||||
description: "",
|
||||
fields: () => ({
|
||||
text: {
|
||||
type: new GraphQLNonNull(GraphQLString),
|
||||
description: ""
|
||||
}
|
||||
})
|
||||
});
|
||||
const CreateTodoSuccess = {};
|
||||
const CreateTodoFailure = {};
|
||||
const UpdateTodoTextResult = { __resolveType: undefined };
|
||||
const UpdateTodoTextInput = new GraphQLInputObjectType({
|
||||
name: "UpdateTodoTextInput",
|
||||
description: "",
|
||||
fields: () => ({
|
||||
id: {
|
||||
type: new GraphQLNonNull(GraphQLID),
|
||||
description: ""
|
||||
},
|
||||
text: {
|
||||
type: new GraphQLNonNull(GraphQLString),
|
||||
description: ""
|
||||
}
|
||||
})
|
||||
});
|
||||
const UpdateTodoTextSuccess = {};
|
||||
const UpdateTodoTextFailure = {};
|
||||
const SetTodoCompletedResult = { __resolveType: undefined };
|
||||
const SetTodoCompletedInput = new GraphQLInputObjectType({
|
||||
name: "SetTodoCompletedInput",
|
||||
description: "",
|
||||
fields: () => ({
|
||||
id: {
|
||||
type: new GraphQLNonNull(GraphQLID),
|
||||
description: ""
|
||||
},
|
||||
isCompleted: {
|
||||
type: new GraphQLNonNull(GraphQLBoolean),
|
||||
description: ""
|
||||
}
|
||||
})
|
||||
});
|
||||
const SetTodoCompletedSuccess = {};
|
||||
const SetTodoCompletedFailure = {};
|
||||
export const resolvers = { Query, Mutation, Todo, Failure, CreateTodoResult, CreateTodoInput, CreateTodoSuccess, CreateTodoFailure, UpdateTodoTextResult, UpdateTodoTextInput, UpdateTodoTextSuccess, UpdateTodoTextFailure, SetTodoCompletedResult, SetTodoCompletedInput, SetTodoCompletedSuccess, SetTodoCompletedFailure };
|
|
@ -0,0 +1,25 @@
|
|||
import { ApolloLink, Observable } from "@apollo/client";
|
||||
|
||||
export function asyncSplit(
|
||||
test: () => Promise<boolean> | boolean,
|
||||
left: () => Promise<ApolloLink>,
|
||||
right: () => Promise<ApolloLink>
|
||||
): ApolloLink {
|
||||
let link: ApolloLink;
|
||||
return new ApolloLink((operation, forward) => {
|
||||
if (link) {
|
||||
return link.request(operation, forward);
|
||||
} else {
|
||||
return new Observable((observer) => {
|
||||
(async () => {
|
||||
if (await test()) {
|
||||
link = await left();
|
||||
} else {
|
||||
link = await right();
|
||||
}
|
||||
link.request(operation, forward)?.subscribe(observer);
|
||||
})();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
import { execute as graphQLExecute, isInputType, parse } from "graphql";
|
||||
import {
|
||||
extractImplicitTypes,
|
||||
Resolvers,
|
||||
specifiedScalars,
|
||||
} from "@graphitation/supermassive";
|
||||
import { ApolloLink, Observable } from "@apollo/client";
|
||||
import { resolvers, TodoStorage } from "./resolvers";
|
||||
import schema from "./schema";
|
||||
import typeDefs from "./typeDefs.graphql";
|
||||
|
||||
export const executableSchemaLink = new ApolloLink((operation) => {
|
||||
return new Observable((observer) => {
|
||||
(async () => {
|
||||
try {
|
||||
const result = await graphQLExecute({
|
||||
document: operation.query,
|
||||
schema,
|
||||
contextValue: {
|
||||
todoStorage: new TodoStorage(window.localStorage),
|
||||
},
|
||||
});
|
||||
observer.next(result);
|
||||
observer.complete();
|
||||
} catch (e) {
|
||||
observer.error(e);
|
||||
}
|
||||
})();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,27 @@
|
|||
import { ApolloLink, Observable } from "@apollo/client";
|
||||
import {
|
||||
executeWithoutSchema as supermassiveExecute,
|
||||
Resolvers,
|
||||
} from "@graphitation/supermassive";
|
||||
import { resolvers, TodoStorage } from "./resolvers";
|
||||
import { resolvers as generatedResolvers } from "./__generated__/typeDefs";
|
||||
|
||||
export const supermassiveSchemaLink = new ApolloLink((operation) => {
|
||||
return new Observable((observer) => {
|
||||
(async () => {
|
||||
try {
|
||||
const result = await supermassiveExecute({
|
||||
document: operation?.query as any,
|
||||
resolvers: { ...generatedResolvers, ...resolvers } as any,
|
||||
contextValue: {
|
||||
todoStorage: new TodoStorage(window.localStorage),
|
||||
},
|
||||
});
|
||||
observer.next(result);
|
||||
observer.complete();
|
||||
} catch (e) {
|
||||
observer.error(e);
|
||||
}
|
||||
})();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,173 @@
|
|||
import { v4 } from "uuid";
|
||||
// import { Resolvers } from "@graphitation/supermassive";
|
||||
|
||||
interface Todo {
|
||||
id: string;
|
||||
text: string;
|
||||
isCompleted: boolean;
|
||||
}
|
||||
|
||||
const ALL_TODOS_KEY = "SUPERMASSIVE_ALL_TODOS";
|
||||
|
||||
export class TodoStorage {
|
||||
localStorage: Storage;
|
||||
|
||||
constructor(localStorage: Storage) {
|
||||
this.localStorage = localStorage;
|
||||
}
|
||||
|
||||
getAllTodos(): Array<Todo> {
|
||||
const existingTodos = this.localStorage.getItem(ALL_TODOS_KEY);
|
||||
if (existingTodos) {
|
||||
return JSON.parse(existingTodos) as any as Array<Todo>;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
saveTodos(todos: Array<Todo>): void {
|
||||
this.localStorage.setItem(ALL_TODOS_KEY, JSON.stringify(todos));
|
||||
}
|
||||
|
||||
createTodo(text: string): Todo {
|
||||
const todos = this.getAllTodos();
|
||||
const todo: Todo = {
|
||||
id: v4(),
|
||||
text,
|
||||
isCompleted: false,
|
||||
};
|
||||
todos.push(todo);
|
||||
this.saveTodos(todos);
|
||||
return todo;
|
||||
}
|
||||
|
||||
updateTodo({
|
||||
id,
|
||||
text,
|
||||
isCompleted,
|
||||
}: {
|
||||
id: string;
|
||||
text?: string;
|
||||
isCompleted?: boolean;
|
||||
}): Todo | null {
|
||||
const todos = this.getAllTodos();
|
||||
const todoIndex = findIndex(todos, (otherTodo) => otherTodo.id === id);
|
||||
if (todoIndex !== -1) {
|
||||
if (text) {
|
||||
todos[todoIndex].text = text;
|
||||
}
|
||||
if (isCompleted) {
|
||||
todos[todoIndex].isCompleted = isCompleted;
|
||||
}
|
||||
this.saveTodos(todos);
|
||||
}
|
||||
return todos[todoIndex];
|
||||
}
|
||||
|
||||
deleteTodo(id: string): void {
|
||||
const todos = this.getAllTodos();
|
||||
const todoIndex = findIndex(todos, (otherTodo) => otherTodo.id === id);
|
||||
if (todoIndex !== -1) {
|
||||
todos.splice(todoIndex, 1);
|
||||
this.saveTodos(todos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type Context = {
|
||||
todoStorage: TodoStorage;
|
||||
};
|
||||
|
||||
export const resolvers: any = {
|
||||
Query: {
|
||||
allTodos(
|
||||
_source: any,
|
||||
_args: any,
|
||||
context: { todoStorage: { getAllTodos: () => any } },
|
||||
_info: any
|
||||
) {
|
||||
return context.todoStorage.getAllTodos();
|
||||
},
|
||||
},
|
||||
Mutation: {
|
||||
createTodo(
|
||||
_source: any,
|
||||
{ input }: any,
|
||||
context: { todoStorage: { createTodo: (arg0: any) => any } },
|
||||
_info: any
|
||||
) {
|
||||
const result = context.todoStorage.createTodo(input.text);
|
||||
if (result != null) {
|
||||
return {
|
||||
__typename: "CreateTodoSuccess",
|
||||
todo: result,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
__typename: "CreateTodoFailure",
|
||||
reason: "haha",
|
||||
};
|
||||
}
|
||||
},
|
||||
updateTodoText(
|
||||
_source: any,
|
||||
{ input }: any,
|
||||
context: {
|
||||
todoStorage: { updateTodo: (arg0: { id: any; text: any }) => any };
|
||||
},
|
||||
_info: any
|
||||
) {
|
||||
const result = context.todoStorage.updateTodo({
|
||||
id: input.id,
|
||||
text: input.text,
|
||||
});
|
||||
if (result != null) {
|
||||
return {
|
||||
__typename: "UpdateTodoTextSuccess",
|
||||
todo: result,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
__typename: "UpdateTodoTextFailure",
|
||||
reason: "haha",
|
||||
};
|
||||
}
|
||||
},
|
||||
setTodoCompleted(
|
||||
_source: any,
|
||||
{ input }: any,
|
||||
context: {
|
||||
todoStorage: {
|
||||
updateTodo: (arg0: { id: any; isCompleted: any }) => any;
|
||||
};
|
||||
},
|
||||
_info: any
|
||||
) {
|
||||
const result = context.todoStorage.updateTodo({
|
||||
id: input.id,
|
||||
isCompleted: input.isCompleted,
|
||||
});
|
||||
if (result != null) {
|
||||
return {
|
||||
__typename: "SetTodoCompletedSuccess",
|
||||
todo: result,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
__typename: "SetTodoCompletedFailure",
|
||||
reason: "haha",
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
function findIndex<A>(arr: Array<A>, finder: (element: A) => Boolean): number {
|
||||
const result = [];
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (finder(arr[i])) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
import typeDefs from "./typeDefs.graphql";
|
||||
import { resolvers } from "./resolvers";
|
||||
import { makeExecutableSchema } from "@graphql-tools/schema";
|
||||
|
||||
const schema = makeExecutableSchema({
|
||||
typeDefs,
|
||||
resolvers,
|
||||
});
|
||||
|
||||
export default schema;
|
|
@ -0,0 +1,63 @@
|
|||
type Query {
|
||||
allTodos: [Todo!]!
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
createTodo(input: CreateTodoInput!): CreateTodoResult!
|
||||
updateTodoText(input: UpdateTodoTextInput!): UpdateTodoTextResult!
|
||||
setTodoCompleted(input: SetTodoCompletedInput!): SetTodoCompletedResult!
|
||||
}
|
||||
|
||||
type Todo {
|
||||
id: ID!
|
||||
text: String!
|
||||
isCompleted: Boolean!
|
||||
}
|
||||
|
||||
interface Failure {
|
||||
reason: String!
|
||||
}
|
||||
|
||||
union CreateTodoResult = CreateTodoSuccess | CreateTodoFailure
|
||||
|
||||
input CreateTodoInput {
|
||||
text: String!
|
||||
}
|
||||
|
||||
type CreateTodoSuccess {
|
||||
todo: Todo!
|
||||
}
|
||||
|
||||
type CreateTodoFailure implements Failure {
|
||||
reason: String!
|
||||
}
|
||||
|
||||
union UpdateTodoTextResult = UpdateTodoTextSuccess | UpdateTodoTextFailure
|
||||
|
||||
input UpdateTodoTextInput {
|
||||
id: ID!
|
||||
text: String!
|
||||
}
|
||||
|
||||
type UpdateTodoTextSuccess {
|
||||
todo: Todo!
|
||||
}
|
||||
|
||||
type UpdateTodoTextFailure implements Failure {
|
||||
reason: String!
|
||||
}
|
||||
|
||||
union SetTodoCompletedResult = SetTodoCompletedSuccess | SetTodoCompletedFailure
|
||||
|
||||
input SetTodoCompletedInput {
|
||||
id: ID!
|
||||
isCompleted: Boolean!
|
||||
}
|
||||
|
||||
type SetTodoCompletedSuccess {
|
||||
todo: Todo!
|
||||
}
|
||||
|
||||
type SetTodoCompletedFailure implements Failure {
|
||||
reason: String!
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"ts-node": {
|
||||
"transpileOnly": true,
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"target": "ES5",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"moduleType": {
|
||||
"webpack.config.ts": "cjs"
|
||||
}
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react",
|
||||
"target": "ES2019",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
const webpack = require("webpack");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const { getTransformer } = require("@graphitation/ts-transform-graphql-js-tag");
|
||||
const {
|
||||
annotateDocumentGraphQLTransform,
|
||||
} = require("@graphitation/supermassive");
|
||||
const StatoscopeWebpackPlugin = require("@statoscope/webpack-plugin").default;
|
||||
const { buildASTSchema, parse } = require("graphql");
|
||||
|
||||
const config: () => Promise<typeof webpack.Configuration> = async () => {
|
||||
return {
|
||||
devtool: "inline-source-map",
|
||||
entry: "./src/index.tsx",
|
||||
output: {
|
||||
filename: "[name].bundle.js",
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
loader: "ts-loader",
|
||||
options: {
|
||||
getCustomTransformers: () => ({
|
||||
before: [
|
||||
getTransformer({
|
||||
graphqlTagModuleExport: "graphql",
|
||||
transformer: annotateDocumentGraphQLTransform(
|
||||
buildASTSchema(
|
||||
parse(
|
||||
fs.readFileSync("./src/schema/typeDefs.graphql", {
|
||||
encoding: "utf-8",
|
||||
})
|
||||
)
|
||||
)
|
||||
),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.graphql$/,
|
||||
loader: "webpack-graphql-loader",
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".ts", ".tsx", ".js"],
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin(),
|
||||
new StatoscopeWebpackPlugin({
|
||||
saveReportTo: "stats/report-[name]-[hash].html",
|
||||
saveStatsTo: "stats/stats-[name]-[hash].json",
|
||||
open: false,
|
||||
}),
|
||||
],
|
||||
optimization: {
|
||||
// minimize: false,
|
||||
splitChunks: {
|
||||
chunks: "initial",
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = config;
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -9,7 +9,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"clean": "git clean -fdx -e node_modules",
|
||||
"build": "lage build",
|
||||
"build-only": "lage build",
|
||||
"build": "lage build && lage types",
|
||||
"types": "lage types",
|
||||
"test": "lage test",
|
||||
"lint": "lage lint",
|
||||
|
@ -21,7 +22,7 @@
|
|||
"release": "yarn beachball publish"
|
||||
},
|
||||
"devDependencies": {
|
||||
"beachball": "2.2.0",
|
||||
"beachball": "^2.20.0",
|
||||
"lage": "0.29.1",
|
||||
"prettier": "^2.2.1"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,33 @@
|
|||
{
|
||||
"name": "@graphitation/apollo-mock-client",
|
||||
"entries": [
|
||||
{
|
||||
"date": "Tue, 14 Dec 2021 10:13:54 GMT",
|
||||
"tag": "@graphitation/apollo-mock-client_v0.9.0",
|
||||
"version": "0.9.0",
|
||||
"comments": {
|
||||
"minor": [
|
||||
{
|
||||
"author": "mnovikov@microsoft.com",
|
||||
"package": "@graphitation/apollo-mock-client",
|
||||
"commit": "fad5f1bc587470a2c85bf5763bb102a179a592b2",
|
||||
"comment": "Support ESM in distro packages"
|
||||
},
|
||||
{
|
||||
"author": "beachball",
|
||||
"package": "@graphitation/apollo-mock-client",
|
||||
"comment": "Bump @graphitation/graphql-js-tag to v0.7.0",
|
||||
"commit": "fc3bf93bc5d50221d8539fe79704c45bc2612786"
|
||||
},
|
||||
{
|
||||
"author": "beachball",
|
||||
"package": "@graphitation/apollo-mock-client",
|
||||
"comment": "Bump @graphitation/graphql-js-operation-payload-generator to v0.7.0",
|
||||
"commit": "fc3bf93bc5d50221d8539fe79704c45bc2612786"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Tue, 26 Oct 2021 21:09:29 GMT",
|
||||
"tag": "@graphitation/apollo-mock-client_v0.6.11",
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
# Change Log - @graphitation/apollo-mock-client
|
||||
|
||||
This log was last generated on Tue, 26 Oct 2021 21:09:29 GMT and should not be manually modified.
|
||||
This log was last generated on Tue, 14 Dec 2021 10:13:54 GMT and should not be manually modified.
|
||||
|
||||
<!-- Start content -->
|
||||
|
||||
## 0.9.0
|
||||
|
||||
Tue, 14 Dec 2021 10:13:54 GMT
|
||||
|
||||
### Minor changes
|
||||
|
||||
- Support ESM in distro packages (mnovikov@microsoft.com)
|
||||
- Bump @graphitation/graphql-js-tag to v0.7.0
|
||||
- Bump @graphitation/graphql-js-operation-payload-generator to v0.7.0
|
||||
|
||||
## 0.6.11
|
||||
|
||||
Tue, 26 Oct 2021 21:09:29 GMT
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "@graphitation/apollo-mock-client",
|
||||
"description": "An Apollo Client that allows mocking of payloads in response to operations, rather than having to provide them all upfront.",
|
||||
"license": "MIT",
|
||||
"version": "0.6.11",
|
||||
"version": "0.9.0",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "monorepo-scripts build",
|
||||
|
@ -13,8 +13,8 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@apollo/client": "^3.3.15",
|
||||
"@graphitation/graphql-js-tag": "^0.5.5",
|
||||
"@graphitation/graphql-js-operation-payload-generator": "^0.5.10",
|
||||
"@graphitation/graphql-js-tag": "^0.7.0",
|
||||
"@graphitation/graphql-js-operation-payload-generator": "^0.7.0",
|
||||
"@types/invariant": "^2.2.34",
|
||||
"@types/jest": "^26.0.22",
|
||||
"@types/react": "^17.0.3",
|
||||
|
@ -32,8 +32,15 @@
|
|||
"invariant": "^2.2.4"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "./lib/index",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"module": "./lib/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,45 @@
|
|||
{
|
||||
"name": "@graphitation/apollo-react-relay-duct-tape",
|
||||
"entries": [
|
||||
{
|
||||
"date": "Tue, 14 Dec 2021 10:13:54 GMT",
|
||||
"tag": "@graphitation/apollo-react-relay-duct-tape_v0.6.0",
|
||||
"version": "0.6.0",
|
||||
"comments": {
|
||||
"minor": [
|
||||
{
|
||||
"author": "mnovikov@microsoft.com",
|
||||
"package": "@graphitation/apollo-react-relay-duct-tape",
|
||||
"commit": "fad5f1bc587470a2c85bf5763bb102a179a592b2",
|
||||
"comment": "Support ESM in distro packages"
|
||||
},
|
||||
{
|
||||
"author": "beachball",
|
||||
"package": "@graphitation/apollo-react-relay-duct-tape",
|
||||
"comment": "Bump @graphitation/apollo-mock-client to v0.9.0",
|
||||
"commit": "fc3bf93bc5d50221d8539fe79704c45bc2612786"
|
||||
},
|
||||
{
|
||||
"author": "beachball",
|
||||
"package": "@graphitation/apollo-react-relay-duct-tape",
|
||||
"comment": "Bump @graphitation/graphql-js-operation-payload-generator to v0.7.0",
|
||||
"commit": "fc3bf93bc5d50221d8539fe79704c45bc2612786"
|
||||
},
|
||||
{
|
||||
"author": "beachball",
|
||||
"package": "@graphitation/apollo-react-relay-duct-tape",
|
||||
"comment": "Bump @graphitation/graphql-js-tag to v0.7.0",
|
||||
"commit": "fc3bf93bc5d50221d8539fe79704c45bc2612786"
|
||||
},
|
||||
{
|
||||
"author": "beachball",
|
||||
"package": "@graphitation/apollo-react-relay-duct-tape",
|
||||
"comment": "Bump relay-compiler-language-graphitation to v0.6.0",
|
||||
"commit": "fc3bf93bc5d50221d8539fe79704c45bc2612786"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Tue, 26 Oct 2021 21:09:29 GMT",
|
||||
"tag": "@graphitation/apollo-react-relay-duct-tape_v0.4.5",
|
||||
|
|
|
@ -1,9 +1,21 @@
|
|||
# Change Log - @graphitation/apollo-react-relay-duct-tape
|
||||
|
||||
This log was last generated on Tue, 26 Oct 2021 21:09:29 GMT and should not be manually modified.
|
||||
This log was last generated on Tue, 14 Dec 2021 10:13:54 GMT and should not be manually modified.
|
||||
|
||||
<!-- Start content -->
|
||||
|
||||
## 0.6.0
|
||||
|
||||
Tue, 14 Dec 2021 10:13:54 GMT
|
||||
|
||||
### Minor changes
|
||||
|
||||
- Support ESM in distro packages (mnovikov@microsoft.com)
|
||||
- Bump @graphitation/apollo-mock-client to v0.9.0
|
||||
- Bump @graphitation/graphql-js-operation-payload-generator to v0.7.0
|
||||
- Bump @graphitation/graphql-js-tag to v0.7.0
|
||||
- Bump relay-compiler-language-graphitation to v0.6.0
|
||||
|
||||
## 0.4.5
|
||||
|
||||
Tue, 26 Oct 2021 21:09:29 GMT
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "@graphitation/apollo-react-relay-duct-tape",
|
||||
"description": "A compatibility wrapper that provides the react-relay API on top of Apollo Client.",
|
||||
"license": "MIT",
|
||||
"version": "0.4.5",
|
||||
"version": "0.6.0",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "monorepo-scripts build",
|
||||
|
@ -14,16 +14,16 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@apollo/client": "^3.3.15",
|
||||
"@graphitation/apollo-mock-client": "^0.6.11",
|
||||
"@graphitation/graphql-js-operation-payload-generator": "^0.5.10",
|
||||
"@graphitation/graphql-js-tag": "^0.5.5",
|
||||
"@graphitation/apollo-mock-client": "^0.9.0",
|
||||
"@graphitation/graphql-js-operation-payload-generator": "^0.7.0",
|
||||
"@graphitation/graphql-js-tag": "^0.7.0",
|
||||
"@types/jest": "^26.0.22",
|
||||
"@types/react": "^17.0.3",
|
||||
"graphql": "^15.0.0",
|
||||
"monorepo-scripts": "*",
|
||||
"react": "^17.0.2",
|
||||
"relay-compiler": "^11.0.2",
|
||||
"relay-compiler-language-graphitation": "^0.5.3",
|
||||
"relay-compiler-language-graphitation": "^0.6.0",
|
||||
"ts-expect": "^1.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
@ -34,7 +34,15 @@
|
|||
"invariant": "^2.2.4"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "./lib/index",
|
||||
"types": "./lib/index.d.ts"
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"access": "public",
|
||||
"module": "./lib/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,21 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Tue, 14 Dec 2021 10:13:54 GMT",
|
||||
"tag": "@graphitation/graphql-eslint-rules_v0.3.0",
|
||||
"version": "0.3.0",
|
||||
"comments": {
|
||||
"minor": [
|
||||
{
|
||||
"author": "mnovikov@microsoft.com",
|
||||
"package": "@graphitation/graphql-eslint-rules",
|
||||
"commit": "fad5f1bc587470a2c85bf5763bb102a179a592b2",
|
||||
"comment": "Support ESM in distro packages"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Wed, 15 Dec 2021 12:36:10 GMT",
|
||||
"tag": "@graphitation/graphql-eslint-rules_v0.2.2",
|
||||
|
|
|
@ -13,6 +13,14 @@ Mon, 20 Dec 2021 18:28:16 GMT
|
|||
- [eslint-rules] Added autofix for missing-key-fields (jakubvejr@microsoft.com)
|
||||
- @graphitation/graphql-eslint-rules version update (jakubvejr@microsoft.com)
|
||||
|
||||
## 0.3.0
|
||||
|
||||
Tue, 14 Dec 2021 10:13:54 GMT
|
||||
|
||||
### Minor changes
|
||||
|
||||
- Support ESM in distro packages (mnovikov@microsoft.com)
|
||||
|
||||
## 0.2.2
|
||||
|
||||
Wed, 15 Dec 2021 12:36:10 GMT
|
||||
|
|
|
@ -20,8 +20,15 @@
|
|||
"graphql": "^15.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "./lib/index",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"module": "./lib/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,27 @@
|
|||
{
|
||||
"name": "@graphitation/graphql-js-operation-payload-generator",
|
||||
"entries": [
|
||||
{
|
||||
"date": "Tue, 14 Dec 2021 10:13:54 GMT",
|
||||
"tag": "@graphitation/graphql-js-operation-payload-generator_v0.7.0",
|
||||
"version": "0.7.0",
|
||||
"comments": {
|
||||
"minor": [
|
||||
{
|
||||
"author": "mnovikov@microsoft.com",
|
||||
"package": "@graphitation/graphql-js-operation-payload-generator",
|
||||
"commit": "fad5f1bc587470a2c85bf5763bb102a179a592b2",
|
||||
"comment": "Support ESM in distro packages"
|
||||
},
|
||||
{
|
||||
"author": "beachball",
|
||||
"package": "@graphitation/graphql-js-operation-payload-generator",
|
||||
"comment": "Bump @graphitation/graphql-js-tag to v0.7.0",
|
||||
"commit": "fc3bf93bc5d50221d8539fe79704c45bc2612786"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Tue, 26 Oct 2021 21:09:29 GMT",
|
||||
"tag": "@graphitation/graphql-js-operation-payload-generator_v0.5.10",
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
# Change Log - @graphitation/graphql-js-operation-payload-generator
|
||||
|
||||
This log was last generated on Tue, 26 Oct 2021 21:09:29 GMT and should not be manually modified.
|
||||
This log was last generated on Tue, 14 Dec 2021 10:13:54 GMT and should not be manually modified.
|
||||
|
||||
<!-- Start content -->
|
||||
|
||||
## 0.7.0
|
||||
|
||||
Tue, 14 Dec 2021 10:13:54 GMT
|
||||
|
||||
### Minor changes
|
||||
|
||||
- Support ESM in distro packages (mnovikov@microsoft.com)
|
||||
- Bump @graphitation/graphql-js-tag to v0.7.0
|
||||
|
||||
## 0.5.10
|
||||
|
||||
Tue, 26 Oct 2021 21:09:29 GMT
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "@graphitation/graphql-js-operation-payload-generator",
|
||||
"description": "Generates a payload for a given GraphQL operation expressed in graphql-js AST and a GraphQL Schema.",
|
||||
"license": "MIT",
|
||||
"version": "0.5.10",
|
||||
"version": "0.7.0",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "monorepo-scripts build",
|
||||
|
@ -15,14 +15,21 @@
|
|||
"deepmerge": "^4.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@graphitation/graphql-js-tag": "^0.5.5",
|
||||
"@graphitation/graphql-js-tag": "^0.7.0",
|
||||
"@types/jest": "^26.0.22",
|
||||
"monorepo-scripts": "*",
|
||||
"relay-test-utils-internal": "^11.0.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "./lib/index",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"module": "./lib/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
{
|
||||
"name": "@graphitation/graphql-js-tag",
|
||||
"entries": [
|
||||
{
|
||||
"date": "Tue, 14 Dec 2021 10:13:54 GMT",
|
||||
"tag": "@graphitation/graphql-js-tag_v0.7.0",
|
||||
"version": "0.7.0",
|
||||
"comments": {
|
||||
"minor": [
|
||||
{
|
||||
"author": "mnovikov@microsoft.com",
|
||||
"package": "@graphitation/graphql-js-tag",
|
||||
"commit": "fad5f1bc587470a2c85bf5763bb102a179a592b2",
|
||||
"comment": "Support ESM in distro packages"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Tue, 26 Oct 2021 21:09:29 GMT",
|
||||
"tag": "@graphitation/graphql-js-tag_v0.5.5",
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
# Change Log - @graphitation/graphql-js-tag
|
||||
|
||||
This log was last generated on Tue, 26 Oct 2021 21:09:29 GMT and should not be manually modified.
|
||||
This log was last generated on Tue, 14 Dec 2021 10:13:54 GMT and should not be manually modified.
|
||||
|
||||
<!-- Start content -->
|
||||
|
||||
## 0.7.0
|
||||
|
||||
Tue, 14 Dec 2021 10:13:54 GMT
|
||||
|
||||
### Minor changes
|
||||
|
||||
- Support ESM in distro packages (mnovikov@microsoft.com)
|
||||
|
||||
## 0.5.5
|
||||
|
||||
Tue, 26 Oct 2021 21:09:29 GMT
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "@graphitation/graphql-js-tag",
|
||||
"description": "A simple graphql-js AST based `graphql` tagged template function.",
|
||||
"license": "MIT",
|
||||
"version": "0.5.5",
|
||||
"version": "0.7.0",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "monorepo-scripts build",
|
||||
|
@ -18,9 +18,16 @@
|
|||
"monorepo-scripts": "*"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "./lib/index",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"module": "./lib/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"invariant": "^2.0.0"
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
{
|
||||
"name": "relay-compiler-language-graphitation",
|
||||
"entries": [
|
||||
{
|
||||
"date": "Tue, 14 Dec 2021 10:13:54 GMT",
|
||||
"tag": "relay-compiler-language-graphitation_v0.6.0",
|
||||
"version": "0.6.0",
|
||||
"comments": {
|
||||
"minor": [
|
||||
{
|
||||
"author": "mnovikov@microsoft.com",
|
||||
"package": "relay-compiler-language-graphitation",
|
||||
"commit": "fad5f1bc587470a2c85bf5763bb102a179a592b2",
|
||||
"comment": "Support ESM in distro packages"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Tue, 26 Oct 2021 21:09:29 GMT",
|
||||
"tag": "relay-compiler-language-graphitation_v0.5.3",
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
# Change Log - relay-compiler-language-graphitation
|
||||
|
||||
This log was last generated on Tue, 26 Oct 2021 21:09:29 GMT and should not be manually modified.
|
||||
This log was last generated on Tue, 14 Dec 2021 10:13:54 GMT and should not be manually modified.
|
||||
|
||||
<!-- Start content -->
|
||||
|
||||
## 0.6.0
|
||||
|
||||
Tue, 14 Dec 2021 10:13:54 GMT
|
||||
|
||||
### Minor changes
|
||||
|
||||
- Support ESM in distro packages (mnovikov@microsoft.com)
|
||||
|
||||
## 0.5.3
|
||||
|
||||
Tue, 26 Oct 2021 21:09:29 GMT
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"name": "relay-compiler-language-graphitation",
|
||||
"description": "A relay-compiler plugin that wraps the TypeScript plugin and augments it slightly for @graphitation/apollo-react-relay-duct-tape's needs.",
|
||||
"license": "MIT",
|
||||
"version": "0.5.3",
|
||||
"main": "./lib/index",
|
||||
"version": "0.6.0",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "monorepo-scripts build",
|
||||
"lint": "monorepo-scripts lint",
|
||||
|
@ -23,7 +23,15 @@
|
|||
"graphql": "^15.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "./lib/index",
|
||||
"access": "public"
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"access": "public",
|
||||
"module": "./lib/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"composite": false,
|
||||
"composite": true,
|
||||
"incremental": true,
|
||||
"tsBuildInfoFile": ".tsbuildinfo",
|
||||
"target": "es5",
|
||||
|
@ -8,8 +8,6 @@
|
|||
"moduleResolution": "Node",
|
||||
"rootDir": "src",
|
||||
"outDir": "lib",
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"strict": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true
|
||||
|
|
|
@ -4,3 +4,4 @@
|
|||
tsconfig.json
|
||||
.tsbuildinfo
|
||||
CHANGELOG.json
|
||||
example/
|
|
@ -1,6 +1,21 @@
|
|||
{
|
||||
"name": "@graphitation/supermassive",
|
||||
"entries": [
|
||||
{
|
||||
"date": "Tue, 14 Dec 2021 10:13:54 GMT",
|
||||
"tag": "@graphitation/supermassive_v0.3.0",
|
||||
"version": "0.3.0",
|
||||
"comments": {
|
||||
"minor": [
|
||||
{
|
||||
"author": "mnovikov@microsoft.com",
|
||||
"package": "@graphitation/supermassive",
|
||||
"commit": "fad5f1bc587470a2c85bf5763bb102a179a592b2",
|
||||
"comment": "Support ESM in distro packages"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Thu, 09 Dec 2021 14:41:56 GMT",
|
||||
"tag": "@graphitation/supermassive_v0.2.0",
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
# Change Log - @graphitation/supermassive
|
||||
|
||||
This log was last generated on Fri, 26 Nov 2021 15:43:37 GMT and should not be manually modified.
|
||||
This log was last generated on Tue, 14 Dec 2021 10:13:54 GMT and should not be manually modified.
|
||||
|
||||
<!-- Start content -->
|
||||
|
||||
## 0.3.0
|
||||
|
||||
Tue, 14 Dec 2021 10:13:54 GMT
|
||||
|
||||
### Minor changes
|
||||
|
||||
- Support ESM in distro packages (mnovikov@microsoft.com)
|
||||
|
||||
## 0.2.0
|
||||
|
||||
Fri, 26 Nov 2021 15:43:37 GMT
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
(function () {
|
||||
require("../lib/bin/supermassive").supermassive().parseAsync(process.argv);
|
||||
require("../lib/cjs/bin/supermassive")
|
||||
.supermassive()
|
||||
.parseAsync(process.argv);
|
||||
})();
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
{
|
||||
"name": "@graphitation/supermassive",
|
||||
"license": "MIT",
|
||||
"version": "0.2.0",
|
||||
"main": "./src/index.js",
|
||||
"version": "0.3.0",
|
||||
"bin": {
|
||||
"supermassive": "./bin/supermassive.js"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
},
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "monorepo-scripts build",
|
||||
"lint": "monorepo-scripts lint",
|
||||
|
@ -33,9 +27,16 @@
|
|||
"ts-node": "^10.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "./lib/index",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"module": "./lib/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@graphql-tools/schema": "^7.1.5",
|
||||
|
|
|
@ -5,16 +5,9 @@ import {
|
|||
executeWithoutSchema,
|
||||
extractImplicitTypes,
|
||||
specifiedScalars,
|
||||
} from ".";
|
||||
import resolvers from "./benchmarks/swapi-schema/resolvers";
|
||||
} from "./index";
|
||||
import { PromiseOrValue } from "./jsutils/PromiseOrValue";
|
||||
import {
|
||||
FieldResolver,
|
||||
TypeResolver,
|
||||
Resolvers,
|
||||
ExecutionResult,
|
||||
ExecutionWithSchemaArgs,
|
||||
} from "./types";
|
||||
import { Resolvers, ExecutionResult, ExecutionWithSchemaArgs } from "./types";
|
||||
|
||||
export function executeWithSchema({
|
||||
typeDefs,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export { executeWithoutSchema } from "./executeWithoutSchema";
|
||||
export { executeWithSchema } from "./executeWithSchema";
|
||||
|
||||
export { Resolvers } from "./types";
|
||||
export type { Resolvers } from "./types";
|
||||
|
||||
export { addTypesToRequestDocument } from "./ast/addTypesToRequestDocument";
|
||||
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
{
|
||||
"name": "@graphitation/ts-transform-graphql-js-tag",
|
||||
"entries": [
|
||||
{
|
||||
"date": "Tue, 14 Dec 2021 10:13:54 GMT",
|
||||
"tag": "@graphitation/ts-transform-graphql-js-tag_v0.3.0",
|
||||
"version": "0.3.0",
|
||||
"comments": {
|
||||
"minor": [
|
||||
{
|
||||
"author": "mnovikov@microsoft.com",
|
||||
"package": "@graphitation/ts-transform-graphql-js-tag",
|
||||
"commit": "fad5f1bc587470a2c85bf5763bb102a179a592b2",
|
||||
"comment": "Support ESM in distro packages"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"date": "Fri, 26 Nov 2021 15:43:37 GMT",
|
||||
"tag": "@graphitation/ts-transform-graphql-js-tag_v0.2.2",
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
# Change Log - @graphitation/ts-transform-graphql-js-tag
|
||||
|
||||
This log was last generated on Fri, 26 Nov 2021 15:43:37 GMT and should not be manually modified.
|
||||
This log was last generated on Tue, 14 Dec 2021 10:13:54 GMT and should not be manually modified.
|
||||
|
||||
<!-- Start content -->
|
||||
|
||||
## 0.3.0
|
||||
|
||||
Tue, 14 Dec 2021 10:13:54 GMT
|
||||
|
||||
### Minor changes
|
||||
|
||||
- Support ESM in distro packages (mnovikov@microsoft.com)
|
||||
|
||||
## 0.2.2
|
||||
|
||||
Fri, 26 Nov 2021 15:43:37 GMT
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@graphitation/ts-transform-graphql-js-tag",
|
||||
"license": "MIT",
|
||||
"version": "0.2.2",
|
||||
"version": "0.3.0",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "monorepo-scripts build",
|
||||
|
@ -18,9 +18,16 @@
|
|||
"ts-transformer-testing-library": "^1.0.0-alpha.7"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "./lib/index",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"module": "./lib/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/index.mjs",
|
||||
"require": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"graphql": "^15.6.1",
|
||||
|
|
|
@ -6,11 +6,18 @@ import {
|
|||
argv,
|
||||
parallel,
|
||||
EsbuildBuildOptions,
|
||||
series,
|
||||
} from "just-scripts";
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
import * as glob from "fast-glob";
|
||||
|
||||
export const types = tscTask({ emitDeclarationOnly: true });
|
||||
export const types = () => {
|
||||
return tscTask({
|
||||
outDir: "lib",
|
||||
emitDeclarationOnly: true,
|
||||
});
|
||||
};
|
||||
|
||||
export const build = () => {
|
||||
const baseEsbuildOptions: EsbuildBuildOptions = {
|
||||
|
@ -22,7 +29,28 @@ export const build = () => {
|
|||
esbuildTask({
|
||||
...baseEsbuildOptions,
|
||||
format: "esm",
|
||||
bundle: true,
|
||||
outExtension: { ".js": ".mjs" },
|
||||
plugins: [
|
||||
{
|
||||
name: "add-mjs",
|
||||
setup(build) {
|
||||
build.onResolve({ filter: /.*/ }, (args) => {
|
||||
if (args.importer) {
|
||||
let extPath = args.path;
|
||||
if (extPath.startsWith(".")) {
|
||||
extPath = extPath + ".mjs";
|
||||
}
|
||||
return {
|
||||
path: extPath,
|
||||
namespace: "magic",
|
||||
external: true,
|
||||
};
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
esbuildTask({
|
||||
...baseEsbuildOptions,
|
||||
|
|
55
yarn.lock
55
yarn.lock
|
@ -837,6 +837,27 @@
|
|||
minimatch "^3.0.4"
|
||||
strip-json-comments "^3.1.1"
|
||||
|
||||
"@graphitation/apollo-mock-client@^0.6.11":
|
||||
version "0.6.11"
|
||||
resolved "https://registry.yarnpkg.com/@graphitation/apollo-mock-client/-/apollo-mock-client-0.6.11.tgz#d933ad450f558bb246bf50b33088813dc111a8fc"
|
||||
integrity sha512-y/nbepeTDdRuKp3OIeOKmHipPpiDUwDHoGoLHT0pwvUU8Nul8mrSHz34E4FJtMAdKow/nNOofj1xsWF1309Uew==
|
||||
dependencies:
|
||||
invariant "^2.2.4"
|
||||
|
||||
"@graphitation/graphql-js-operation-payload-generator@^0.5.10":
|
||||
version "0.5.10"
|
||||
resolved "https://registry.yarnpkg.com/@graphitation/graphql-js-operation-payload-generator/-/graphql-js-operation-payload-generator-0.5.10.tgz#cb5389a6f1be7fc7fc05268de89337345fa66de8"
|
||||
integrity sha512-wDAy9AKq5yYdF7r401m6zsZig5g0henXih7HMAADgTrfKSvynOH9PK8dsdmv0X2jm5Atit9YHQNtlJ9sWKiWWA==
|
||||
dependencies:
|
||||
deepmerge "^4.2.2"
|
||||
|
||||
"@graphitation/graphql-js-tag@^0.5.5":
|
||||
version "0.5.5"
|
||||
resolved "https://registry.yarnpkg.com/@graphitation/graphql-js-tag/-/graphql-js-tag-0.5.5.tgz#766d8668d86795c28d3e685d55007280e5b23ba8"
|
||||
integrity sha512-/QYGILQoS0+DTuH/Kn/PQsgcs3xwvfyr1qY0uy3gcdWZzQts6tuY4A0rvWy2AYbw997iCn4YILBjQ6PV6j2HRg==
|
||||
dependencies:
|
||||
invariant "^2.0.0"
|
||||
|
||||
"@graphql-eslint/eslint-plugin@^3.0.0":
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@graphql-eslint/eslint-plugin/-/eslint-plugin-3.0.0.tgz#d0f7d6e4f6f772312500abbf6c94c59d5cb52c12"
|
||||
|
@ -2318,16 +2339,17 @@ bcrypt-pbkdf@^1.0.0:
|
|||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
beachball@2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/beachball/-/beachball-2.2.0.tgz#5b74cc1a01097a24a4f683f3608368b26f6a2174"
|
||||
integrity sha512-2cell9HViD9navg+txbnOybmL7hbpdZBRcx930Gv/92ZyqAmIr7gHTsyZv90tzkeYvUh+xDZGbEBGddLF1QOUg==
|
||||
beachball@^2.20.0:
|
||||
version "2.20.0"
|
||||
resolved "https://registry.yarnpkg.com/beachball/-/beachball-2.20.0.tgz#7fe55e7d86c9c890de15474c84f6a32653bdb6ca"
|
||||
integrity sha512-vVdF6qDDurO66GZigUtqKuXzQM8ImlG7MgN5iTj9rvZ4RM6vy+nklu0EmqaQtqS5K6hZ4WrHDwgcR/kLa0VHpA==
|
||||
dependencies:
|
||||
cosmiconfig "^6.0.0"
|
||||
execa "^4.0.3"
|
||||
fs-extra "^8.0.1"
|
||||
git-url-parse "^11.1.2"
|
||||
glob "^7.1.4"
|
||||
human-id "^2.0.1"
|
||||
lodash "^4.17.15"
|
||||
minimatch "^3.0.4"
|
||||
p-limit "^3.0.2"
|
||||
|
@ -2335,7 +2357,7 @@ beachball@2.2.0:
|
|||
semver "^6.1.1"
|
||||
toposort "^2.0.2"
|
||||
uuid "^8.3.1"
|
||||
workspace-tools "^0.14.0"
|
||||
workspace-tools "^0.16.2"
|
||||
yargs-parser "^20.2.4"
|
||||
|
||||
benchmark@^2.1.4:
|
||||
|
@ -4048,6 +4070,11 @@ http-signature@~1.2.0:
|
|||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
human-id@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/human-id/-/human-id-2.0.1.tgz#71aadd0f46d577fd982358133cfd43f2a46f1477"
|
||||
integrity sha512-XWoYbGsEfBB0mtUHiyihsefgf+s1tNQHj7sX1kgDxUM0IEKk8rcZIPTwUpqDdFIQbkViOLejbc0t8jBzz5jL3w==
|
||||
|
||||
human-signals@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
|
||||
|
@ -7543,10 +7570,10 @@ wordwrap@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
|
||||
integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=
|
||||
|
||||
workspace-tools@^0.14.0:
|
||||
version "0.14.1"
|
||||
resolved "https://registry.yarnpkg.com/workspace-tools/-/workspace-tools-0.14.1.tgz#db65c5e01d93021520634a0f4501b95457a9a436"
|
||||
integrity sha512-39eUegRij7gXmlxo9S/x8p1Bv5MDjCJmj/1ERwD8epQM5DM3kWZFJhpuq9m5kcL1qT6ny02GgRbIyr4whsX+kQ==
|
||||
workspace-tools@^0.15.0:
|
||||
version "0.15.0"
|
||||
resolved "https://registry.yarnpkg.com/workspace-tools/-/workspace-tools-0.15.0.tgz#8710f6151b21ab4382a5230d752e8b822ea24d16"
|
||||
integrity sha512-KYSEKdqRJC3moABdCho03nSK4H9oqb6KtvGusGi5giR5oV1LilCRqem7STLRsZlnTJVTATv4nHnnioB+wSleDA==
|
||||
dependencies:
|
||||
"@pnpm/lockfile-file" "^3.0.7"
|
||||
"@pnpm/logger" "^3.2.2"
|
||||
|
@ -7560,13 +7587,11 @@ workspace-tools@^0.14.0:
|
|||
multimatch "^4.0.0"
|
||||
read-yaml-file "^2.0.0"
|
||||
|
||||
workspace-tools@^0.15.0:
|
||||
version "0.15.0"
|
||||
resolved "https://registry.yarnpkg.com/workspace-tools/-/workspace-tools-0.15.0.tgz#8710f6151b21ab4382a5230d752e8b822ea24d16"
|
||||
integrity sha512-KYSEKdqRJC3moABdCho03nSK4H9oqb6KtvGusGi5giR5oV1LilCRqem7STLRsZlnTJVTATv4nHnnioB+wSleDA==
|
||||
workspace-tools@^0.16.2:
|
||||
version "0.16.2"
|
||||
resolved "https://registry.yarnpkg.com/workspace-tools/-/workspace-tools-0.16.2.tgz#b7355c811dcda648d12e92ceb89f8fccacca3901"
|
||||
integrity sha512-Z/NHo4t39DUd50MdWiPfxICyVaCjWZc/xwZxE4a/n2nAQGgeYeg6GWBY1juULPi/BGSrjSVaDQfDCj/Y80033A==
|
||||
dependencies:
|
||||
"@pnpm/lockfile-file" "^3.0.7"
|
||||
"@pnpm/logger" "^3.2.2"
|
||||
"@yarnpkg/lockfile" "^1.1.0"
|
||||
find-up "^4.1.0"
|
||||
find-yarn-workspace-root "^1.2.1"
|
||||
|
|
Загрузка…
Ссылка в новой задаче