Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump bob-the-bundler to latest version #2481

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/chilly-fans-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'graphql-modules': major
---

upgrade bundler to latest version

The latest version of `bob-the-bundler` has a better support to ESM, fix type declaration for `exports` statement, and more.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"babel-plugin-parameter-decorator": "1.0.16",
"babel-plugin-transform-typescript-metadata": "0.3.2",
"babel-jest": "29.7.0",
"bob-the-bundler": "1.7.3",
"bob-the-bundler": "7.0.1",
"chalk": "4.1.2",
"dataloader": "2.2.2",
"eslint": "8.55.0",
Expand Down
36 changes: 21 additions & 15 deletions packages/graphql-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,28 @@
"author": "Kamil Kisiela",
"license": "MIT",
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.mjs",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./index.d.ts"
"require": {
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
},
"default": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs",
"types": "./*.d.ts"
}
"./package.json": "./package.json"
},
"typings": "dist/index.d.ts",
"typings": "dist/typings/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
"definition": "dist/typings/index.d.ts"
},
"scripts": {
"prepack": "bob prepack"
Expand All @@ -43,13 +48,14 @@
"ramda": "^0.29.0"
},
"publishConfig": {
"access": "public",
"directory": "dist"
"directory": "dist",
"access": "public"
},
"buildOptions": {
"copy": [
"LICENSE.md",
"README.md"
]
}
},
"type": "module"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main reason I've considered a major bump.

It might impact in some projects

}
8 changes: 4 additions & 4 deletions packages/graphql-modules/src/application/apollo.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { wrapSchema } from '@graphql-tools/wrap';
import { DocumentNode, execute, GraphQLSchema } from 'graphql';
import { uniqueId } from '../shared/utils';
import { InternalAppContext } from './application';
import { ExecutionContextBuilder } from './context';
import { Application } from './types';
import { uniqueId } from '../shared/utils.js';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all those extension changes was done via bob bootstrap

import { InternalAppContext } from './application.js';
import { ExecutionContextBuilder } from './context.js';
import { Application } from './types.js';

const CONTEXT_ID = Symbol.for('context-id');

Expand Down
32 changes: 16 additions & 16 deletions packages/graphql-modules/src/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ import {
onlySingletonProviders,
onlyOperationProviders,
Scope,
} from '../di';
import { ResolvedModule } from '../module/factory';
import { ID } from '../shared/types';
} from '../di/index.js';
import { ResolvedModule } from '../module/factory.js';
import { ID } from '../shared/types.js';
import {
ModuleDuplicatedError,
ModuleNonUniqueIdError,
} from '../shared/errors';
import { flatten, isDefined } from '../shared/utils';
import { ApplicationConfig, Application } from './types';
} from '../shared/errors.js';
import { flatten, isDefined } from '../shared/utils.js';
import { ApplicationConfig, Application } from './types.js';
import {
createGlobalProvidersMap,
attachGlobalProvidersMap,
instantiateSingletonProviders,
} from './di';
import { createContextBuilder } from './context';
import { executionCreator } from './execution';
import { subscriptionCreator } from './subscription';
import { apolloSchemaCreator, apolloExecutorCreator } from './apollo';
import { operationControllerCreator } from './operation-controller';
import { Module } from '../module/types';
} from './di.js';
import { createContextBuilder } from './context.js';
import { executionCreator } from './execution.js';
import { subscriptionCreator } from './subscription.js';
import { apolloSchemaCreator, apolloExecutorCreator } from './apollo.js';
import { operationControllerCreator } from './operation-controller.js';
import { Module } from '../module/types.js';

export type ModulesMap = Map<ID, ResolvedModule>;

Expand All @@ -45,9 +45,9 @@ export interface InternalAppContext {
*
* ```typescript
* import { createApplication } from 'graphql-modules';
* import { usersModule } from './users';
* import { postsModule } from './posts';
* import { commentsModule } from './comments';
* import { usersModule } from './users.js';
* import { postsModule } from './posts.js';
* import { commentsModule } from './comments.js';
*
* const app = createApplication({
* modules: [
Expand Down
14 changes: 7 additions & 7 deletions packages/graphql-modules/src/application/context.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Injector, ReflectiveInjector } from '../di';
import { ResolvedProvider } from '../di/resolution';
import { ID } from '../shared/types';
import { once, merge } from '../shared/utils';
import type { InternalAppContext, ModulesMap } from './application';
import { attachGlobalProvidersMap } from './di';
import { CONTEXT } from './tokens';
import { Injector, ReflectiveInjector } from '../di/index.js';
import { ResolvedProvider } from '../di/resolution.js';
import { ID } from '../shared/types.js';
import { once, merge } from '../shared/utils.js';
import type { InternalAppContext, ModulesMap } from './application.js';
import { attachGlobalProvidersMap } from './di.js';
import { CONTEXT } from './tokens.js';

export type ExecutionContextBuilder<
TContext extends {
Expand Down
8 changes: 4 additions & 4 deletions packages/graphql-modules/src/application/di.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ModulesMap } from './application';
import { ResolvedModule } from '../module/factory';
import { ReflectiveInjector, Scope } from '../di';
import { ResolvedProvider } from '../di/resolution';
import { ModulesMap } from './application.js';
import { ResolvedModule } from '../module/factory.js';
import { ReflectiveInjector, Scope } from '../di/index.js';
import { ResolvedProvider } from '../di/resolution.js';

export function instantiateSingletonProviders({
appInjector,
Expand Down
8 changes: 4 additions & 4 deletions packages/graphql-modules/src/application/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
GraphQLSchema,
GraphQLTypeResolver,
} from 'graphql';
import { Application } from './types';
import { ExecutionContextBuilder } from './context';
import { Maybe } from '../shared/types';
import { isNotSchema } from '../shared/utils';
import { Application } from './types.js';
import { ExecutionContextBuilder } from './context.js';
import { Maybe } from '../shared/types.js';
import { isNotSchema } from '../shared/utils.js';

export function executionCreator({
contextBuilder,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Application } from './types';
import type { ExecutionContextBuilder } from './context';
import type { Application } from './types.js';
import type { ExecutionContextBuilder } from './context.js';

export function operationControllerCreator(options: {
contextBuilder: ExecutionContextBuilder<GraphQLModules.GlobalContext>;
Expand Down
8 changes: 4 additions & 4 deletions packages/graphql-modules/src/application/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import {
subscribe,
SubscriptionArgs,
} from 'graphql';
import { Maybe } from '../shared/types';
import { Maybe } from '../shared/types.js';
import {
tapAsyncIterator,
isAsyncIterable,
isNotSchema,
} from '../shared/utils';
import { ExecutionContextBuilder } from './context';
import { Application } from './types';
} from '../shared/utils.js';
import { ExecutionContextBuilder } from './context.js';
import { Application } from './types.js';

export function subscriptionCreator({
contextBuilder,
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-modules/src/application/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InjectionToken } from '../di';
import { InjectionToken } from '../di/index.js';

/**
* @api
Expand Down
12 changes: 6 additions & 6 deletions packages/graphql-modules/src/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {
GraphQLSchema,
ExecutionResult,
} from 'graphql';
import type { Provider, Injector } from '../di';
import type { Resolvers, Module, MockedModule } from '../module/types';
import type { MiddlewareMap } from '../shared/middleware';
import type { ApolloRequestContext } from './apollo';
import type { Single } from '../shared/types';
import type { InternalAppContext } from './application';
import type { Provider, Injector } from '../di/index.js';
import type { Resolvers, Module, MockedModule } from '../module/types.js';
import type { MiddlewareMap } from '../shared/middleware.js';
import type { ApolloRequestContext } from './apollo.js';
import type { Single } from '../shared/types.js';
import type { InternalAppContext } from './application.js';

type Execution = typeof execute;
type Subscription = typeof subscribe;
Expand Down
6 changes: 3 additions & 3 deletions packages/graphql-modules/src/di/decorators.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Type, ProviderOptions, isType, InjectionToken } from './providers';
import { Type, ProviderOptions, isType, InjectionToken } from './providers.js';
import {
INJECTABLE,
InjectableMetadata,
readInjectableMetadata,
ensureInjectableMetadata,
} from './metadata';
import { Injector } from './injector';
} from './metadata.js';
import { Injector } from './injector.js';

function ensureReflect() {
if (!(Reflect && Reflect.getOwnMetadata)) {
Expand Down
10 changes: 5 additions & 5 deletions packages/graphql-modules/src/di/errors.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { InjectableParamMetadata } from './metadata';
import { Type, InjectionToken } from './providers';
import { InjectableParamMetadata } from './metadata.js';
import { Type, InjectionToken } from './providers.js';
import {
stringify,
wrappedError,
ERROR_ORIGINAL_ERROR,
getOriginalError,
} from './utils';
import { ReflectiveInjector } from './injector';
import { Key } from './registry';
} from './utils.js';
import { ReflectiveInjector } from './injector.js';
import { Key } from './registry.js';

export function invalidProviderError(provider: any) {
return Error(
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql-modules/src/di/forward-ref.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { stringify } from './utils';
import { Type } from './providers';
import { stringify } from './utils.js';
import { Type } from './providers.js';

export type ForwardRefFn<T> = () => T;

Expand Down
15 changes: 10 additions & 5 deletions packages/graphql-modules/src/di/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
export { Injectable, Optional, Inject, ExecutionContext } from './decorators';
export { forwardRef } from './forward-ref';
export {
Injectable,
Optional,
Inject,
ExecutionContext,
} from './decorators.js';
export { forwardRef } from './forward-ref.js';
export {
InjectionToken,
Type,
Expand All @@ -14,6 +19,6 @@ export {
Scope,
onlySingletonProviders,
onlyOperationProviders,
} from './providers';
export { Injector, ReflectiveInjector } from './injector';
export { InjectionError } from './errors';
} from './providers.js';
export { Injector, ReflectiveInjector } from './injector.js';
export { InjectionError } from './errors.js';
10 changes: 5 additions & 5 deletions packages/graphql-modules/src/di/injector.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Type, InjectionToken, Provider } from './providers';
import { Type, InjectionToken, Provider } from './providers.js';
import {
ResolvedProvider,
resolveProviders,
Dependency,
GlobalProviderMap,
} from './resolution';
import { Key } from './registry';
} from './resolution.js';
import { Key } from './registry.js';
import {
noProviderError,
cyclicDependencyError,
instantiationError,
} from './errors';
import { ExecutionContext } from './decorators';
} from './errors.js';
import { ExecutionContext } from './decorators.js';

const _THROW_IF_NOT_FOUND = new Object();
const UNDEFINED = new Object();
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql-modules/src/di/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { noInjectableError } from './errors';
import { Type, ProviderOptions, InjectionToken } from './providers';
import { noInjectableError } from './errors.js';
import { Type, ProviderOptions, InjectionToken } from './providers.js';

export const INJECTABLE = Symbol('di:injectable');

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-modules/src/di/providers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readInjectableMetadata } from './metadata';
import { readInjectableMetadata } from './metadata.js';

export const Type = Function;

Expand Down
6 changes: 3 additions & 3 deletions packages/graphql-modules/src/di/registry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { stringify } from './utils';
import { resolveForwardRef } from './forward-ref';
import { Type } from './providers';
import { stringify } from './utils.js';
import { resolveForwardRef } from './forward-ref.js';
import { Type } from './providers.js';

export class Key {
constructor(
Expand Down
12 changes: 6 additions & 6 deletions packages/graphql-modules/src/di/resolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
Type,
isClassProvider,
isFactoryProvider,
} from './providers';
import { invalidProviderError, noAnnotationError } from './errors';
import { Key } from './registry';
import { resolveForwardRef } from './forward-ref';
import { readInjectableMetadata, InjectableParamMetadata } from './metadata';
import { ReflectiveInjector } from './injector';
} from './providers.js';
import { invalidProviderError, noAnnotationError } from './errors.js';
import { Key } from './registry.js';
import { resolveForwardRef } from './forward-ref.js';
import { readInjectableMetadata, InjectableParamMetadata } from './metadata.js';
import { ReflectiveInjector } from './injector.js';

export type NormalizedProvider<T = any> =
| ValueProvider<T>
Expand Down