diff --git a/benchmark/package.json b/benchmark/package.json index 591f8b105d8a..1ae0629ccc79 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -33,7 +33,7 @@ "!*/__tests__" ], "dependencies": { - "@loopback/context": "^3.8.2", + "@loopback/core": "^2.7.1", "@loopback/example-todo": "^3.5.0", "@loopback/openapi-spec-builder": "^2.1.6", "@loopback/rest": "^5.1.0", diff --git a/benchmark/src/context-binding/context-binding.ts b/benchmark/src/context-binding/context-binding.ts index b3d178a8bf96..949d4f56760c 100644 --- a/benchmark/src/context-binding/context-binding.ts +++ b/benchmark/src/context-binding/context-binding.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject, Provider, ValueFactory} from '@loopback/context'; +import {Context, inject, Provider, ValueFactory} from '@loopback/core'; import Benchmark from 'benchmark'; /** diff --git a/benchmark/tsconfig.json b/benchmark/tsconfig.json index f65422c27403..127a39ed1f76 100644 --- a/benchmark/tsconfig.json +++ b/benchmark/tsconfig.json @@ -14,7 +14,7 @@ "path": "../examples/todo/tsconfig.json" }, { - "path": "../packages/context/tsconfig.json" + "path": "../packages/core/tsconfig.json" }, { "path": "../packages/openapi-spec-builder/tsconfig.json" diff --git a/docs/site/BelongsTo-relation.md b/docs/site/BelongsTo-relation.md index 284e7a9e936c..917ad3daf965 100644 --- a/docs/site/BelongsTo-relation.md +++ b/docs/site/BelongsTo-relation.md @@ -238,7 +238,7 @@ The following code snippet shows how it would look like: content="/src/repositories/order.repository.ts" %} ```ts -import {Getter, inject} from '@loopback/context'; +import {Getter, inject} from '@loopback/core'; import { BelongsToAccessor, DefaultCrudRepository, diff --git a/docs/site/Binding.md b/docs/site/Binding.md index 74b6b819864f..acede6c529be 100644 --- a/docs/site/Binding.md +++ b/docs/site/Binding.md @@ -32,6 +32,7 @@ There are a few ways to create a binding: - Use `Binding` constructor: ```ts + import {Context, Binding} from '@loopback/core'; const context = new Context(); const binding = new Binding('my-key'); ctx.add(binding); @@ -40,6 +41,7 @@ There are a few ways to create a binding: - Use `Binding.bind()` ```ts + import {Context, Binding} from '@loopback/core'; const context = new Context(); const binding = Binding.bind('my-key'); ctx.add(binding); @@ -48,10 +50,24 @@ There are a few ways to create a binding: - Use `context.bind()` ```ts + import {Context, Binding} from '@loopback/core'; const context = new Context(); context.bind('my-key'); ``` + {% include note.html content="The `@loopback/core` package re-exports all + public APIs of `@loopback/context`. For consistency, we recommend the usage of + `@loopback/core` for imports in LoopBack modules and applications unless they + depend on `@loopback/context` explicitly. The two statements below are + equivalent: + + ```ts + import {inject} from '@loopback/context'; + import {inject} from '@loopback/core'; + ``` + + " %} + ## How to set up a binding? The `Binding` class provides a set of fluent APIs to create and configure a @@ -87,7 +103,7 @@ The factory function can receive extra information about the context, binding, and resolution options. ```ts -import {ValueFactory} from '@loopback/context'; +import {ValueFactory} from '@loopback/core'; // The factory function now have access extra metadata about the resolution const factory: ValueFactory = resolutionCtx => { @@ -113,7 +129,7 @@ An advanced form of value factory is a class that has a static `value` method that allows parameter injection. ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; class GreetingProvider { static value(@inject('user') user: string) { @@ -458,7 +474,7 @@ match/find bindings by tag. The search criteria can be one of the followings: filterByTag, includesTagValue, // Match tag value as an array that includes the item TagValueMatcher, - } from '@loopback/context'; + } from '@loopback/core'; // Match a binding with a named service ctx.find(filterByTag({name: ANY_TAG_VALUE, service: 'service'})); @@ -504,7 +520,7 @@ When the class is bound, these attributes are honored to create a binding. You can use `@bind` decorator to configure how to bind a class. ```ts -import {bind, BindingScope} from '@loopback/context'; +import {bind, BindingScope} from '@loopback/core'; // @bind() accepts scope and tags @bind({ @@ -538,7 +554,7 @@ export class YourController {} Then a binding can be created by inspecting the class, ```ts -import {createBindingFromClass} from '@loopback/context'; +import {createBindingFromClass} from '@loopback/core'; const ctx = new Context(); const binding = createBindingFromClass(MyService); diff --git a/docs/site/Context.md b/docs/site/Context.md index 5216621ae181..c0078be25bc7 100644 --- a/docs/site/Context.md +++ b/docs/site/Context.md @@ -37,13 +37,26 @@ can be chained using the `parent` to form a hierarchy. For example, the code below creates a chain of three contexts: `reqCtx -> serverCtx -> rootCtx`. ```ts -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; const rootCtx = new Context('root-ctx'); // No parent const serverCtx = new Context(rootCtx, 'server-ctx'); // rootCtx as the parent const reqCtx = new Context(serverCtx); // No explicit name, a UUID will be generated ``` +{% include note.html content="The `@loopback/core` package re-exports all public +APIs of `@loopback/context`. For consistency, we recommend the usage of +`@loopback/core` for imports in LoopBack modules and applications unless they +depend on `@loopback/context` explicitly. The two statements below are +equivalent: + +```ts +import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; +``` + +" %} + LoopBack's context system allows an unlimited amount of Context instances, each of which may have a parent Context. @@ -180,8 +193,7 @@ However, when using classes, LoopBack provides a better way to get at stuff in the context via the `@inject` decorator: ```ts -import {inject} from '@loopback/context'; -import {Application} from '@loopback/core'; +import {inject, Application} from '@loopback/core'; const app = new Application(); app.bind('defaultName').to('John'); @@ -489,7 +501,7 @@ be used to watch a list of bindings matching certain criteria depicted by a matched bindings. ```ts -import {Context, ContextView} from '@loopback/context'; +import {Context, ContextView} from '@loopback/core'; // Set up a context chain const appCtx = new Context('app'); diff --git a/docs/site/Controller-generator.md b/docs/site/Controller-generator.md index 27ea530c1fa5..04a1c76f3680 100644 --- a/docs/site/Controller-generator.md +++ b/docs/site/Controller-generator.md @@ -51,7 +51,7 @@ based on the given name: ```ts // Uncomment these imports to begin using these cool features! -// import {inject} from '@loopback/context'; +// import {inject} from '@loopback/core'; export class FooController { constructor() {} diff --git a/docs/site/Creating-components.md b/docs/site/Creating-components.md index be5563996df5..3ddaa1502c5c 100644 --- a/docs/site/Creating-components.md +++ b/docs/site/Creating-components.md @@ -90,7 +90,7 @@ function called by [Context](Context.md) when another entity requests a value to be injected. ```ts -import {Provider} from '@loopback/context'; +import {Provider} from '@loopback/core'; export class MyValueProvider implements Provider { value() { @@ -168,7 +168,7 @@ the list of keys reserved for the framework use. Provider's `value()` method can be asynchronous too: ```ts -import {Provider} from '@loopback/context'; +import {Provider} from '@loopback/core'; const request = require('request-promise-native'); const weatherUrl = 'http://samples.openweathermap.org/data/2.5/weather?appid=b1b15e88fa797225412429c1c50c122a1'; @@ -192,7 +192,7 @@ dependencies annotated with `@inject` keyword, so that LoopBack runtime can resolve them automatically. ```ts -import {Provider} from '@loopback/context'; +import {Provider} from '@loopback/core'; import {Request, RestBindings} from '@loopback/rest'; import {v4 as uuid} from 'uuid'; diff --git a/docs/site/Dependency-injection.md b/docs/site/Dependency-injection.md index 9c2cb5918d77..ba5807d722bb 100644 --- a/docs/site/Dependency-injection.md +++ b/docs/site/Dependency-injection.md @@ -22,6 +22,8 @@ the caller specify which strategy to use. The implementation of the `authenticate` action is shown below. ```ts +import {inject, Provider} from '@loopback/core'; + export class AuthenticateActionProvider implements Provider { constructor( // The provider is instantiated for Sequence constructor, @@ -73,6 +75,19 @@ export class AuthenticateActionProvider implements Provider { } ``` +{% include note.html content="The `@loopback/core` package re-exports all public +APIs of `@loopback/context`. For consistency, we recommend the usage of +`@loopback/core` for imports in LoopBack modules and applications unless they +depend on `@loopback/context` explicitly. The two statements below are +equivalent: + +```ts +import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; +``` + +" %} + Dependency Injection makes the code easier to extend and customize, because the dependencies can be easily rewired by the application developer. It makes the code easier to test in isolation (in a pure unit test), because the test can @@ -296,7 +311,7 @@ problem. Consider the following example: ```ts -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; interface Developer { // Each developer belongs to a team @@ -363,7 +378,7 @@ Let's take a look at the following example: The corresponding code is: ```ts -import {inject, Context, BindingScope} from '@loopback/context'; +import {inject, Context, BindingScope} from '@loopback/core'; import {RestBindings} from '@loopback/rest'; interface Logger() { diff --git a/docs/site/Express-middleware.md b/docs/site/Express-middleware.md index cc2e99b411e9..e679da86ac3b 100644 --- a/docs/site/Express-middleware.md +++ b/docs/site/Express-middleware.md @@ -220,7 +220,7 @@ Alternatively, we can create a subclass of `ExpressMiddlewareInterceptorProvider`. ```ts -import {config} from '@loopback/context'; +import {config} from '@loopback/core'; import { ExpressMiddlewareInterceptorProvider, createMiddlewareInterceptorBinding, diff --git a/docs/site/Extending-LoopBack-4.md b/docs/site/Extending-LoopBack-4.md index 4b6166d2c12f..df1c9fc379eb 100644 --- a/docs/site/Extending-LoopBack-4.md +++ b/docs/site/Extending-LoopBack-4.md @@ -46,7 +46,7 @@ that the service provider can be injected into the consumer class. The code snippet below shows the usage of `@inject` for dependency injection. ```ts -import {inject, Context} from '@loopback/context'; +import {inject, Context} from '@loopback/core'; /** * A UserController implementation that depends on UserRepository and PasswordHasher diff --git a/docs/site/Extension-point-and-extensions.md b/docs/site/Extension-point-and-extensions.md index ba2e4ec6bfdf..024ebef3a30d 100644 --- a/docs/site/Extension-point-and-extensions.md +++ b/docs/site/Extension-point-and-extensions.md @@ -68,7 +68,7 @@ decorators and functions are provided to ensure consistency and convention. 1. Inject a getter function for extensions ```ts - import {Getter} from '@loopback/context'; + import {Getter} from '@loopback/core'; import {extensionPoint, extensions} from '@loopback/core'; @extensionPoint('greeters') @@ -81,7 +81,7 @@ decorators and functions are provided to ensure consistency and convention. 2. Inject a context view for extensions ```ts - import {ContextView} from '@loopback/context'; + import {ContextView} from '@loopback/core'; import {extensionPoint, extensions} from '@loopback/core'; @extensionPoint('greeters') diff --git a/docs/site/FAQ.md b/docs/site/FAQ.md index 7ea75f527b72..17ffafab1d41 100644 --- a/docs/site/FAQ.md +++ b/docs/site/FAQ.md @@ -135,7 +135,7 @@ headers). This can be accomplished by injecting the `Response` object into the controller: ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {get, Response, RestBindings} from '@loopback/rest'; export class PingController { diff --git a/docs/site/File-upload-download.md b/docs/site/File-upload-download.md index 11fdd568098b..3e7076e42718 100644 --- a/docs/site/File-upload-download.md +++ b/docs/site/File-upload-download.md @@ -25,7 +25,7 @@ A few steps are involved to create an endpoint for file upload. [`FileUploadController`](https://github.com/strongloop/loopback-next/blob/master/examples/file-transfer/src/controllers/file-upload.controller.ts) ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { post, Request, @@ -110,7 +110,7 @@ To download files from the backend, please follow the following steps. [`FileDownloadController`](https://github.com/strongloop/loopback-next/blob/master/examples/file-transfer/src/controllers/file-download.controller.ts) ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { get, HttpErrors, diff --git a/docs/site/Interceptor-generator.md b/docs/site/Interceptor-generator.md index 9abe322e542a..c1e2798f7eb7 100644 --- a/docs/site/Interceptor-generator.md +++ b/docs/site/Interceptor-generator.md @@ -63,7 +63,7 @@ import { bind, Interceptor, Provider, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as a global `Interceptor` during @@ -115,7 +115,7 @@ import { bind, Interceptor, Provider, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as a global `Interceptor` during diff --git a/docs/site/Interceptors.md b/docs/site/Interceptors.md index 4c8417a68864..4702f0d593b5 100644 --- a/docs/site/Interceptors.md +++ b/docs/site/Interceptors.md @@ -34,7 +34,7 @@ Controller methods decorated with `@intercept` are invoked with applied interceptors for corresponding routes upon API requests. ```ts -import {intercept} from '@loopback/context'; +import {intercept} from '@loopback/core'; @intercept(log) // `log` is an interceptor function export class OrderController { @@ -74,7 +74,7 @@ services and would like to allow repository or service methods to be intercepted. ```ts -import {createProxyWithInterceptors} from '@loopback/context'; +import {createProxyWithInterceptors} from '@loopback/core'; const proxy = createProxyWithInterceptors(controllerInstance, ctx); const msg = await proxy.greet('John'); @@ -148,7 +148,7 @@ To explicitly invoke a method with interceptors, use `invokeMethod` from `RestServer` for controller methods. ```ts -import {Context, invokeMethod} from '@loopback/context'; +import {Context, invokeMethod} from '@loopback/core'; const ctx: Context = new Context(); @@ -336,7 +336,7 @@ Global interceptors are discovered from the `InvocationContext`. They are registered as bindings with `globalInterceptor` tag. For example, ```ts -import {asGlobalInterceptor} from '@loopback/context'; +import {asGlobalInterceptor} from '@loopback/core'; app .bind('globalInterceptors.MetricsInterceptor') @@ -747,7 +747,7 @@ Sometimes we want to apply more than one interceptors together as a whole. It can be done by `composeInterceptors`: ```ts -import {composeInterceptors} from '@loopback/context'; +import {composeInterceptors} from '@loopback/core'; const interceptor = composeInterceptors( interceptorFn1, @@ -768,7 +768,7 @@ is the base class that can be extended to create your own flavor of interceptors and chains. For example, ```ts -import {GenericInvocationChain, GenericInterceptor} from '@loopback/context'; +import {GenericInvocationChain, GenericInterceptor} from '@loopback/core'; import {RequestContext} from '@loopback/rest'; export interface RequestInterceptor @@ -795,7 +795,7 @@ await chain.invokeInterceptors(); It's also possible to pass in a final handler: ```ts -import {Next} from '@loopback/context'; +import {Next} from '@loopback/core'; const finalHandler: Next = async () => { // return ...; }; diff --git a/docs/site/LB3-vs-LB4-request-response-cycle.md b/docs/site/LB3-vs-LB4-request-response-cycle.md index ecd2f02973bf..7239504d9ebf 100644 --- a/docs/site/LB3-vs-LB4-request-response-cycle.md +++ b/docs/site/LB3-vs-LB4-request-response-cycle.md @@ -331,7 +331,7 @@ available to them via [dependency injection](./Dependency-injection.md). Example of accesssing the request and response object in a Controller: ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {Request, Response, RestBindings, get} from '@loopback/rest'; export class ExampleController { diff --git a/docs/site/Life-cycle.md b/docs/site/Life-cycle.md index b7ee0948732b..ca3427049c6d 100644 --- a/docs/site/Life-cycle.md +++ b/docs/site/Life-cycle.md @@ -150,7 +150,7 @@ To react on life cycle events, a life cycle observer implements the `LifeCycleObserver` interface. ```ts -import {ValueOrPromise} from '@loopback/context'; +import {ValueOrPromise} from '@loopback/core'; /** * Observers to handle life cycle start/stop events @@ -236,7 +236,7 @@ The observer class can also be decorated with `@bind` to provide binding metadata. ```ts -import {bind, createBindingFromClass} from '@loopback/context'; +import {bind, createBindingFromClass} from '@loopback/core'; import {CoreTags, asLifeCycleObserver} from '@loopback/core'; @bind( @@ -257,7 +257,7 @@ app.add(createBindingFromClass(MyObserver)); Or even simpler with `@lifeCycleObserver`: ```ts -import {createBindingFromClass} from '@loopback/context'; +import {createBindingFromClass} from '@loopback/core'; import {lifeCycleObserver} from '@loopback/core'; @lifeCycleObserver('g1') diff --git a/docs/site/Loopback-component-authentication.md b/docs/site/Loopback-component-authentication.md index f5932e4a9974..7c3e0dbbaf65 100644 --- a/docs/site/Loopback-component-authentication.md +++ b/docs/site/Loopback-component-authentication.md @@ -146,7 +146,7 @@ Here is an example of the decorator using a custom authentication strategy named authentication strategy in later sections) ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {AuthenticationBindings, authenticate} from '@loopback/authentication'; import {SecurityBindings, securityId, UserProfile} from '@loopback/security'; import {get} from '@loopback/rest'; @@ -715,7 +715,7 @@ with a value of `false` for the `/scareme` endpoint. We use the **default** option value for the `/whoami` endpoint. ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {AuthenticationBindings, authenticate} from '@loopback/authentication'; import {UserProfile, securityId} from '@loopback/security'; import {get} from '@loopback/rest'; diff --git a/docs/site/Middleware.md b/docs/site/Middleware.md index f3c7feeddb9b..66458def9cda 100644 --- a/docs/site/Middleware.md +++ b/docs/site/Middleware.md @@ -71,7 +71,7 @@ work with the `MiddlewareContext` - a wrapper object for `request` and ```ts import {MiddlewareContext} from '@loopback/express'; -import {Next, ValueOrPromise, InvocationResult} from '@loopback/context'; +import {Next, ValueOrPromise, InvocationResult} from '@loopback/core'; (context: MiddlewareContext, next: Next) => ValueOrPromise; ``` diff --git a/docs/site/Repositories.md b/docs/site/Repositories.md index 6e8f6cdcf377..1a817ea29c8e 100644 --- a/docs/site/Repositories.md +++ b/docs/site/Repositories.md @@ -166,7 +166,7 @@ TypeScript version: import {DefaultCrudRepository, juggler} from '@loopback/repository'; import {Account, AccountRelations} from '../models'; import {DbDataSource} from '../datasources'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; export class AccountRepository extends DefaultCrudRepository< Account, @@ -354,7 +354,7 @@ implementation based on `loopback-datasource-juggler`. import {DefaultKeyValueRepository} from '@loopback/repository'; import {ShoppingCart} from '../models/shopping-cart.model'; import {RedisDataSource} from '../datasources/redis.datasource'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; export class ShoppingCartRepository extends DefaultKeyValueRepository< ShoppingCart diff --git a/docs/site/Sequence.md b/docs/site/Sequence.md index 473a692d411b..f6dc0dfbacfa 100644 --- a/docs/site/Sequence.md +++ b/docs/site/Sequence.md @@ -204,7 +204,7 @@ function upon injection. ```ts import {Send, Response} from '@loopback/rest'; -import {Provider, BoundValue, inject} from '@loopback/context'; +import {Provider, BoundValue, inject} from '@loopback/core'; import {writeResultToResponse, RestBindings, Request} from '@loopback/rest'; // Note: This is an example class; we do not provide this for you. @@ -264,7 +264,7 @@ import { } from '@loopback/repository'; import {CustomSendProvider} from './providers/custom-send.provider'; import {Formatter} from './utils'; -import {BindingScope} from '@loopback/context'; +import {BindingScope} from '@loopback/core'; export class YourApp extends RepositoryMixin(RestApplication) { constructor() { diff --git a/docs/site/Testing-Your-Extensions.md b/docs/site/Testing-Your-Extensions.md index c779eabd2687..beebf008f491 100644 --- a/docs/site/Testing-Your-Extensions.md +++ b/docs/site/Testing-Your-Extensions.md @@ -183,7 +183,7 @@ using a test double for any constructor arguments. {% include code-caption.html content="src/providers/random-number.provider.ts" %} ```ts -import {Provider} from '@loopback/context'; +import {Provider} from '@loopback/core'; export class RandomNumberProvider implements Provider { value() { @@ -233,7 +233,7 @@ class. Following is an example for an integration test for a Mixin: {% include code-caption.html content="src/mixins/time.mixin.ts" %} ```ts -import {Constructor} from '@loopback/context'; +import {Constructor} from '@loopback/core'; export function TimeMixin>(superClass: T) { return class extends superClass { constructor(...args: any[]) { diff --git a/docs/site/Testing-your-application.md b/docs/site/Testing-your-application.md index 80a0e8b663c1..29b683711fc7 100644 --- a/docs/site/Testing-your-application.md +++ b/docs/site/Testing-your-application.md @@ -144,7 +144,7 @@ belongs to Category, include it in the repository call, for example: {% include code-caption.html content="src/__tests__/helpers/database.helpers.ts" %} ```ts -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import {ProductRepository, CategoryRepository} from '../../repositories'; import {testdb} from '../fixtures/datasources/testdb.datasource'; diff --git a/docs/site/decorators/Decorators_authenticate.md b/docs/site/decorators/Decorators_authenticate.md index dd8da1120e19..af5089488297 100644 --- a/docs/site/decorators/Decorators_authenticate.md +++ b/docs/site/decorators/Decorators_authenticate.md @@ -20,7 +20,7 @@ Here's an example using 'BasicStrategy': to authenticate user in function {% include code-caption.html content="src/controllers/who-am-i.controller.ts" %} ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {securityId, SecurityBindings, UserProfile} from '@loopback/security'; import {authenticate} from '@loopback/authentication'; import {get} from '@loopback/rest'; diff --git a/docs/site/decorators/Decorators_inject.md b/docs/site/decorators/Decorators_inject.md index 525e7420fd3d..4594a367f69f 100644 --- a/docs/site/decorators/Decorators_inject.md +++ b/docs/site/decorators/Decorators_inject.md @@ -55,7 +55,7 @@ WidgetController: {% include code-caption.html content="src/controllers/widget.controller.ts" %} ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; export class WidgetController { // injection for property @@ -75,6 +75,8 @@ array of values can be injected. If the target type is not `Array`, an error will be thrown. ```ts +import {inject} from '@loopback/core'; + class MyControllerWithValues { constructor( @inject(binding => binding.tagNames.includes('foo')) @@ -87,6 +89,8 @@ To sort matched bindings found by the binding filter function, `@inject` honors `bindingComparator` in `metadata`: ```ts +import {inject} from '@loopback/core'; + class MyControllerWithValues { constructor( @inject(binding => binding.tagNames.includes('foo'), { @@ -100,6 +104,19 @@ class MyControllerWithValues { } ``` +{% include note.html content="The `@loopback/core` package re-exports all public +APIs of `@loopback/context`. For consistency, we recommend the usage of +`@loopback/core` for imports in LoopBack modules and applications unless they +depend on `@loopback/context` explicitly. The two statements below are +equivalent: + +```ts +import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; +``` + +" %} + A few variants of `@inject` are provided to declare special forms of dependencies. @@ -111,7 +128,7 @@ value of the key. Syntax: `@inject.getter(bindingSelector: BindingSelector)`. ```ts -import {inject, Getter} from '@loopback/context'; +import {inject, Getter} from '@loopback/core'; import {UserProfile} from '@loopback/authentication'; import {get} from '@loopback/rest'; @@ -276,7 +293,7 @@ console.log(store.locations); // ['San Francisco', 'San Jose'] a filter function. ```ts -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {DataSource} from '@loopback/repository'; export class DataSourceTracker { diff --git a/docs/site/extending/rest-api.md b/docs/site/extending/rest-api.md index 3d92b2b46f79..41d325501700 100644 --- a/docs/site/extending/rest-api.md +++ b/docs/site/extending/rest-api.md @@ -53,7 +53,7 @@ Example showing a component exporting a `/ping` endpoint at a configurable base path: ```ts -import {config} from '@loopback/context'; +import {config} from '@loopback/core'; import {Component} from '@loopback/core'; import {RestApplication} from '@loopback/rest'; import {MyComponentBindings} from './my-component.keys.ts'; @@ -99,7 +99,7 @@ The example below shows a component that always contributed a `ping` endpoint and sometimes contributes a `stats` endpoint, depending on the configuration. ```ts -import {bind, config, ContextTags} from '@loopback/context'; +import {bind, config, ContextTags} from '@loopback/core'; import {MyComponentBindings} from './my-component.keys.ts'; import {PingController, StatsController} from './controllers'; diff --git a/docs/site/migration/components/project-layout.md b/docs/site/migration/components/project-layout.md index 3480982a3058..8a6d638219fa 100644 --- a/docs/site/migration/components/project-layout.md +++ b/docs/site/migration/components/project-layout.md @@ -57,7 +57,7 @@ The component class is usually implemented inside ```ts import {Application, Component, CoreBindings} from '@loopback/core'; -import {bind, config, ContextTags, inject} from '@loopback/context'; +import {bind, config, ContextTags, inject} from '@loopback/core'; import {MetricsBindings} from './keys'; import {DEFAULT_METRICS_OPTIONS, MetricsOptions} from './types'; diff --git a/docs/site/migration/models/mixins.md b/docs/site/migration/models/mixins.md index a5e50d57182f..f486b53553f0 100644 --- a/docs/site/migration/models/mixins.md +++ b/docs/site/migration/models/mixins.md @@ -160,7 +160,7 @@ This mixin class factory function `AddCategoryPropertyMixin` in {% include code-caption.html content="src/mixins/category-property-mixin.ts" %} ```ts -import {Constructor} from '@loopback/context'; +import {Constructor} from '@loopback/core'; import {property, Model} from '@loopback/repository'; /** @@ -432,7 +432,7 @@ method to any repository. {% include code-caption.html content="src/mixins/find-by-title-repository-mixin.ts" %} ```ts -import {Constructor} from '@loopback/context'; +import {Constructor} from '@loopback/core'; import {Model, CrudRepository, Where} from '@loopback/repository'; import {FindByTitle} from './find-by-title-interface'; @@ -523,7 +523,7 @@ method to any controller. {% include code-caption.html content="src/mixins/src/mixins/find-by-title-controller-mixin.ts" %} ```ts -import {Constructor} from '@loopback/context'; +import {Constructor} from '@loopback/core'; import {Model} from '@loopback/repository'; import {FindByTitle} from './find-by-title-interface'; import {param, get, getModelSchemaRef} from '@loopback/rest'; diff --git a/docs/site/tutorials/core/3-context-in-action.md b/docs/site/tutorials/core/3-context-in-action.md index 01ee37b2e4a0..e6e67d82439c 100644 --- a/docs/site/tutorials/core/3-context-in-action.md +++ b/docs/site/tutorials/core/3-context-in-action.md @@ -34,7 +34,7 @@ To register artifacts, we first create an instance of `Context` and use `bind` to add artifacts to the registry as bindings. ```ts -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import {GreetingController} from './controllers'; import {CACHING_SERVICE, GREETING_SERVICE} from './keys'; import {CachingService} from './caching-service'; diff --git a/docs/site/tutorials/core/4-dependency-injection.md b/docs/site/tutorials/core/4-dependency-injection.md index c7d825876ead..890bfac17d4d 100644 --- a/docs/site/tutorials/core/4-dependency-injection.md +++ b/docs/site/tutorials/core/4-dependency-injection.md @@ -33,7 +33,7 @@ locating the dependent artifacts. For example: 2. Use `ServiceLocator` pattern ```ts - import {Context} from '@loopback/context'; + import {Context} from '@loopback/core'; import {EnglishGreeter, ChineseGreeter} from './greeters'; export class GreetingService { private chineseGreeter: ChineseGreeter; @@ -58,7 +58,7 @@ locating the dependent artifacts. For example: This technique is being used commonly within the LoopBack framework. ```ts - import {inject} from '@loopback/context'; + import {inject} from '@loopback/core'; import {LifeCycleObserver} from '@loopback/core'; import {CachingService} from '../caching-service'; import {CACHING_SERVICE} from '../keys'; diff --git a/docs/site/tutorials/core/5-extension-point-extension.md b/docs/site/tutorials/core/5-extension-point-extension.md index 452151764bcc..17e8f45f6254 100644 --- a/docs/site/tutorials/core/5-extension-point-extension.md +++ b/docs/site/tutorials/core/5-extension-point-extension.md @@ -49,8 +49,7 @@ context. In our case, we mark `GreetingService` as the extension point that has access to a list of greeters which are defined as extensions. ```ts -import {Getter} from '@loopback/context'; -import {extensionFilter, CoreTags} from '@loopback/core'; +import {extensionFilter, CoreTags, Getter} from '@loopback/core'; /** * An extension point for greeters that can greet in different languages */ @@ -164,7 +163,7 @@ knowing much about one another. ```ts import {Greeter, asGreeter} from '../types'; -import {bind, inject} from '@loopback/context'; +import {bind, inject} from '@loopback/core'; /** * Options for the Chinese greeter */ @@ -229,8 +228,7 @@ app The process can be automated with a component: ```ts -import {createBindingFromClass} from '@loopback/context'; -import {Component} from '@loopback/core'; +import {createBindingFromClass, Component} from '@loopback/core'; import {GreetingService} from './greeting-service'; import {GREETING_SERVICE} from './keys'; /** diff --git a/docs/site/tutorials/core/9-boot-by-convention.md b/docs/site/tutorials/core/9-boot-by-convention.md index 8251d76af6b6..a7549984d11f 100644 --- a/docs/site/tutorials/core/9-boot-by-convention.md +++ b/docs/site/tutorials/core/9-boot-by-convention.md @@ -13,7 +13,7 @@ be achieved by calling `Context` APIs or helper methods on the application object: ```ts -import {createBindingFromClass, BindingScope} from '@loopback/context'; +import {createBindingFromClass, BindingScope} from '@loopback/core'; import {CACHING_SERVICE} from './keys'; import {CachingService} from './caching-service'; import {GreetingController} from './controllers'; diff --git a/docs/site/tutorials/soap-calculator/soap-calculator-tutorial-add-controller.md b/docs/site/tutorials/soap-calculator/soap-calculator-tutorial-add-controller.md index ca9d910e630d..4315f382089f 100644 --- a/docs/site/tutorials/soap-calculator/soap-calculator-tutorial-add-controller.md +++ b/docs/site/tutorials/soap-calculator/soap-calculator-tutorial-add-controller.md @@ -42,7 +42,7 @@ this point. ```ts // Uncomment these imports to begin using these cool features! -// import {inject} from '@loopback/context'; +// import {inject} from '@loopback/core'; export class CalculatorController { constructor() {} diff --git a/examples/access-control-migration/package.json b/examples/access-control-migration/package.json index 5ac488287763..998a8c22b10a 100644 --- a/examples/access-control-migration/package.json +++ b/examples/access-control-migration/package.json @@ -42,7 +42,6 @@ "@loopback/authentication": "^4.2.6", "@loopback/authorization": "^0.5.11", "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/access-control-migration/src/components/jwt-authentication/services/jwt.auth.strategy.ts b/examples/access-control-migration/src/components/jwt-authentication/services/jwt.auth.strategy.ts index 216b53cf0bd2..fff1d20ef4e1 100644 --- a/examples/access-control-migration/src/components/jwt-authentication/services/jwt.auth.strategy.ts +++ b/examples/access-control-migration/src/components/jwt-authentication/services/jwt.auth.strategy.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT import {AuthenticationStrategy, TokenService} from '@loopback/authentication'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {HttpErrors, Request} from '@loopback/rest'; import {UserProfile} from '@loopback/security'; import {TokenServiceBindings} from '../keys'; diff --git a/examples/access-control-migration/src/components/jwt-authentication/services/jwt.service.ts b/examples/access-control-migration/src/components/jwt-authentication/services/jwt.service.ts index fc490dbf4c6b..9e35e4403e67 100644 --- a/examples/access-control-migration/src/components/jwt-authentication/services/jwt.service.ts +++ b/examples/access-control-migration/src/components/jwt-authentication/services/jwt.service.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT import {TokenService} from '@loopback/authentication'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {HttpErrors} from '@loopback/rest'; import {securityId, UserProfile} from '@loopback/security'; import {promisify} from 'util'; diff --git a/examples/access-control-migration/src/controllers/user.controller.ts b/examples/access-control-migration/src/controllers/user.controller.ts index ae5a4be53ce7..5858c8c3d780 100644 --- a/examples/access-control-migration/src/controllers/user.controller.ts +++ b/examples/access-control-migration/src/controllers/user.controller.ts @@ -6,7 +6,7 @@ // Uncomment these imports to begin using these cool features! import {TokenService, UserService} from '@loopback/authentication'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {post, requestBody} from '@loopback/rest'; import { Credentials, diff --git a/examples/access-control-migration/src/keys.ts b/examples/access-control-migration/src/keys.ts index af4376b55f3f..8a32bb31475e 100644 --- a/examples/access-control-migration/src/keys.ts +++ b/examples/access-control-migration/src/keys.ts @@ -3,6 +3,6 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; export const RESOURCE_ID = BindingKey.create('resourceId'); diff --git a/examples/access-control-migration/src/sequence.ts b/examples/access-control-migration/src/sequence.ts index 4dbe29f00df5..9d8851a9467b 100644 --- a/examples/access-control-migration/src/sequence.ts +++ b/examples/access-control-migration/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/access-control-migration/tsconfig.json b/examples/access-control-migration/tsconfig.json index 9dffec995c61..a4d3534bda59 100644 --- a/examples/access-control-migration/tsconfig.json +++ b/examples/access-control-migration/tsconfig.json @@ -20,9 +20,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/express-composition/package.json b/examples/express-composition/package.json index c93c0518d556..2d566bb0c15b 100644 --- a/examples/express-composition/package.json +++ b/examples/express-composition/package.json @@ -46,7 +46,6 @@ }, "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/express-composition/src/controllers/ping.controller.ts b/examples/express-composition/src/controllers/ping.controller.ts index 379fa918d3fa..d5d8adb25a5d 100644 --- a/examples/express-composition/src/controllers/ping.controller.ts +++ b/examples/express-composition/src/controllers/ping.controller.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT import {Request, RestBindings, get, ResponseObject} from '@loopback/rest'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; /** * OpenAPI response for ping() diff --git a/examples/express-composition/src/sequence.ts b/examples/express-composition/src/sequence.ts index e17724c297f8..d427b59da402 100644 --- a/examples/express-composition/src/sequence.ts +++ b/examples/express-composition/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/express-composition/tsconfig.json b/examples/express-composition/tsconfig.json index 6c76a6abfbce..a4bb932c1d8b 100644 --- a/examples/express-composition/tsconfig.json +++ b/examples/express-composition/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/file-transfer/package.json b/examples/file-transfer/package.json index f3469d237cae..ef75cee7dbe8 100644 --- a/examples/file-transfer/package.json +++ b/examples/file-transfer/package.json @@ -39,7 +39,6 @@ }, "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/rest": "^5.1.0", diff --git a/examples/file-transfer/src/controllers/file-download.controller.ts b/examples/file-transfer/src/controllers/file-download.controller.ts index 36226e9a6737..ff01df28d913 100644 --- a/examples/file-transfer/src/controllers/file-download.controller.ts +++ b/examples/file-transfer/src/controllers/file-download.controller.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { get, HttpErrors, diff --git a/examples/file-transfer/src/controllers/file-upload.controller.ts b/examples/file-transfer/src/controllers/file-upload.controller.ts index 1cabb70f02ef..32d964558325 100644 --- a/examples/file-transfer/src/controllers/file-upload.controller.ts +++ b/examples/file-transfer/src/controllers/file-upload.controller.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { post, Request, diff --git a/examples/file-transfer/src/sequence.ts b/examples/file-transfer/src/sequence.ts index 5614b94ff584..09a58f8db810 100644 --- a/examples/file-transfer/src/sequence.ts +++ b/examples/file-transfer/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/file-transfer/src/services/file-upload.service.ts b/examples/file-transfer/src/services/file-upload.service.ts index acd0f4b244fa..ce77f006cffb 100644 --- a/examples/file-transfer/src/services/file-upload.service.ts +++ b/examples/file-transfer/src/services/file-upload.service.ts @@ -9,7 +9,7 @@ import { config, ContextTags, Provider, -} from '@loopback/context'; +} from '@loopback/core'; import multer from 'multer'; import {FILE_UPLOAD_SERVICE} from '../keys'; import {FileUploadHandler} from '../types'; diff --git a/examples/file-transfer/tsconfig.json b/examples/file-transfer/tsconfig.json index 2adce6bb6d2a..1f0f3fec3432 100644 --- a/examples/file-transfer/tsconfig.json +++ b/examples/file-transfer/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/greeter-extension/package.json b/examples/greeter-extension/package.json index cd5528a282b4..ef748b50fb6a 100644 --- a/examples/greeter-extension/package.json +++ b/examples/greeter-extension/package.json @@ -55,7 +55,6 @@ "typescript": "~3.9.3" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "chalk": "^4.0.0", diff --git a/examples/greeter-extension/src/component.ts b/examples/greeter-extension/src/component.ts index 0d6a537196e5..b3393c43d8dc 100644 --- a/examples/greeter-extension/src/component.ts +++ b/examples/greeter-extension/src/component.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Binding, createBindingFromClass} from '@loopback/context'; -import {Component} from '@loopback/core'; +import {Binding, createBindingFromClass, Component} from '@loopback/core'; import {ChineseGreeter} from './greeters/greeter-cn'; import {EnglishGreeter} from './greeters/greeter-en'; import {GreetingService} from './greeting-service'; diff --git a/examples/greeter-extension/src/greeters/greeter-cn.ts b/examples/greeter-extension/src/greeters/greeter-cn.ts index cf55c6565d7a..fbebfc791053 100644 --- a/examples/greeter-extension/src/greeters/greeter-cn.ts +++ b/examples/greeter-extension/src/greeters/greeter-cn.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {bind, config} from '@loopback/context'; +import {bind, config} from '@loopback/core'; import {asGreeter, Greeter} from '../types'; /** diff --git a/examples/greeter-extension/src/greeters/greeter-en.ts b/examples/greeter-extension/src/greeters/greeter-en.ts index ecf7b0afc5f6..0c616a5961d8 100644 --- a/examples/greeter-extension/src/greeters/greeter-en.ts +++ b/examples/greeter-extension/src/greeters/greeter-en.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {bind} from '@loopback/context'; +import {bind} from '@loopback/core'; import {asGreeter, Greeter} from '../types'; /** diff --git a/examples/greeter-extension/src/greeting-service.ts b/examples/greeter-extension/src/greeting-service.ts index 22662ca5d7e6..657d6759557b 100644 --- a/examples/greeter-extension/src/greeting-service.ts +++ b/examples/greeter-extension/src/greeting-service.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {config, Getter} from '@loopback/context'; -import {extensionPoint, extensions} from '@loopback/core'; +import {config, Getter, extensionPoint, extensions} from '@loopback/core'; import chalk from 'chalk'; import {Greeter, GREETER_EXTENSION_POINT_NAME} from './types'; diff --git a/examples/greeter-extension/src/keys.ts b/examples/greeter-extension/src/keys.ts index f1e375338767..f1642d10a950 100644 --- a/examples/greeter-extension/src/keys.ts +++ b/examples/greeter-extension/src/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; import {GreetingService} from './greeting-service'; /** diff --git a/examples/greeter-extension/src/types.ts b/examples/greeter-extension/src/types.ts index 6844af9d3fb2..f170dc2e91cb 100644 --- a/examples/greeter-extension/src/types.ts +++ b/examples/greeter-extension/src/types.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingTemplate} from '@loopback/context'; -import {extensionFor} from '@loopback/core'; +import {BindingTemplate, extensionFor} from '@loopback/core'; /** * Typically an extension point defines an interface as the contract for diff --git a/examples/greeter-extension/tsconfig.json b/examples/greeter-extension/tsconfig.json index eff32e5e2b60..4e1d26c08eb1 100644 --- a/examples/greeter-extension/tsconfig.json +++ b/examples/greeter-extension/tsconfig.json @@ -11,9 +11,6 @@ "src/**/*.json" ], "references": [ - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/greeting-app/package.json b/examples/greeting-app/package.json index 01a7f04c45f6..ec68b87d1426 100644 --- a/examples/greeting-app/package.json +++ b/examples/greeting-app/package.json @@ -57,7 +57,6 @@ }, "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/example-greeter-extension": "^2.1.2", "@loopback/openapi-v3": "^3.4.2", diff --git a/examples/greeting-app/src/controllers/greeting.controller.ts b/examples/greeting-app/src/controllers/greeting.controller.ts index 14859523124c..e26ae597f491 100644 --- a/examples/greeting-app/src/controllers/greeting.controller.ts +++ b/examples/greeting-app/src/controllers/greeting.controller.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { GreetingService, GREETING_SERVICE, diff --git a/examples/greeting-app/src/interceptors/caching.interceptor.ts b/examples/greeting-app/src/interceptors/caching.interceptor.ts index 9da11f56cc51..784458bc95bb 100644 --- a/examples/greeting-app/src/interceptors/caching.interceptor.ts +++ b/examples/greeting-app/src/interceptors/caching.interceptor.ts @@ -12,7 +12,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; import {RestBindings} from '@loopback/rest'; import debugFactory from 'debug'; import {CachingService} from '../caching-service'; diff --git a/examples/greeting-app/src/keys.ts b/examples/greeting-app/src/keys.ts index 5ff4f0d46e42..0db4b183d9b4 100644 --- a/examples/greeting-app/src/keys.ts +++ b/examples/greeting-app/src/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; import {CachingService} from './caching-service'; /** diff --git a/examples/greeting-app/src/observers/cache.observer.ts b/examples/greeting-app/src/observers/cache.observer.ts index ab9ec9a1e520..e0ef8e71b976 100644 --- a/examples/greeting-app/src/observers/cache.observer.ts +++ b/examples/greeting-app/src/observers/cache.observer.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; -import {lifeCycleObserver, LifeCycleObserver} from '@loopback/core'; +import {inject, lifeCycleObserver, LifeCycleObserver} from '@loopback/core'; import {CachingService} from '../caching-service'; import {CACHING_SERVICE} from '../keys'; diff --git a/examples/greeting-app/tsconfig.json b/examples/greeting-app/tsconfig.json index 9695c41e066a..72a004274319 100644 --- a/examples/greeting-app/tsconfig.json +++ b/examples/greeting-app/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/lb3-application/package.json b/examples/lb3-application/package.json index 0a0fccf0493f..aada22ee741c 100644 --- a/examples/lb3-application/package.json +++ b/examples/lb3-application/package.json @@ -41,7 +41,6 @@ "dependencies": { "@loopback/boot": "^2.3.2", "@loopback/booter-lb3app": "^2.2.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/repository": "^2.6.0", "@loopback/rest": "^5.1.0", diff --git a/examples/lb3-application/src/sequence.ts b/examples/lb3-application/src/sequence.ts index 48833b0e9d40..195b0e5799db 100644 --- a/examples/lb3-application/src/sequence.ts +++ b/examples/lb3-application/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/lb3-application/tsconfig.json b/examples/lb3-application/tsconfig.json index 9fe5894f0ad7..2c09a7a5472d 100644 --- a/examples/lb3-application/tsconfig.json +++ b/examples/lb3-application/tsconfig.json @@ -17,9 +17,6 @@ { "path": "../../packages/booter-lb3app/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/log-extension/package.json b/examples/log-extension/package.json index b5ce6854e348..9f2adc8e2057 100644 --- a/examples/log-extension/package.json +++ b/examples/log-extension/package.json @@ -53,7 +53,6 @@ "typescript": "~3.9.3" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/rest": "^5.1.0", diff --git a/examples/log-extension/src/__tests__/acceptance/log.extension.acceptance.ts b/examples/log-extension/src/__tests__/acceptance/log.extension.acceptance.ts index acd4f1dd354a..54555402a971 100644 --- a/examples/log-extension/src/__tests__/acceptance/log.extension.acceptance.ts +++ b/examples/log-extension/src/__tests__/acceptance/log.extension.acceptance.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {get, param} from '@loopback/openapi-v3'; import { FindRoute, diff --git a/examples/log-extension/src/decorators/log.decorator.ts b/examples/log-extension/src/decorators/log.decorator.ts index a43efc5c81ff..b7abae053034 100644 --- a/examples/log-extension/src/decorators/log.decorator.ts +++ b/examples/log-extension/src/decorators/log.decorator.ts @@ -8,7 +8,7 @@ import { Constructor, MethodDecoratorFactory, MetadataInspector, -} from '@loopback/context'; +} from '@loopback/core'; import {LevelMetadata} from '../types'; /** diff --git a/examples/log-extension/src/keys.ts b/examples/log-extension/src/keys.ts index c269bf71b1b4..309e138d14aa 100644 --- a/examples/log-extension/src/keys.ts +++ b/examples/log-extension/src/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; import {TimerFn, LogFn, LogWriterFn} from './types'; /** diff --git a/examples/log-extension/src/providers/log-action.provider.ts b/examples/log-extension/src/providers/log-action.provider.ts index 74b81a3223ee..18eb47040497 100644 --- a/examples/log-extension/src/providers/log-action.provider.ts +++ b/examples/log-extension/src/providers/log-action.provider.ts @@ -3,8 +3,13 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Constructor, Getter, inject, Provider} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +import { + Constructor, + Getter, + inject, + Provider, + CoreBindings, +} from '@loopback/core'; import {OperationArgs, Request} from '@loopback/rest'; import chalk from 'chalk'; import {getLogMetadata} from '../decorators'; diff --git a/examples/log-extension/src/providers/timer.provider.ts b/examples/log-extension/src/providers/timer.provider.ts index b8cd4393aedd..1073c68baf3c 100644 --- a/examples/log-extension/src/providers/timer.provider.ts +++ b/examples/log-extension/src/providers/timer.provider.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Provider} from '@loopback/context'; +import {Provider} from '@loopback/core'; import {TimerFn, HighResTime} from '../types'; export class TimerProvider implements Provider { diff --git a/examples/log-extension/tsconfig.json b/examples/log-extension/tsconfig.json index 693d44c01429..2f84603592b2 100644 --- a/examples/log-extension/tsconfig.json +++ b/examples/log-extension/tsconfig.json @@ -11,9 +11,6 @@ "src/**/*.json" ], "references": [ - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/multi-tenancy/package.json b/examples/multi-tenancy/package.json index 5b2b4205e3d2..d74be29784af 100644 --- a/examples/multi-tenancy/package.json +++ b/examples/multi-tenancy/package.json @@ -52,7 +52,6 @@ ], "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/multi-tenancy/src/controllers/ping.controller.ts b/examples/multi-tenancy/src/controllers/ping.controller.ts index c0063f06b214..3527f96602cb 100644 --- a/examples/multi-tenancy/src/controllers/ping.controller.ts +++ b/examples/multi-tenancy/src/controllers/ping.controller.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT import {Request, RestBindings, get, ResponseObject} from '@loopback/rest'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; /** * OpenAPI response for ping() diff --git a/examples/multi-tenancy/src/multi-tenancy/actions/multi-tenancy-action.provider.ts b/examples/multi-tenancy/src/multi-tenancy/actions/multi-tenancy-action.provider.ts index 13db91fed4a8..75ab0b80da8f 100644 --- a/examples/multi-tenancy/src/multi-tenancy/actions/multi-tenancy-action.provider.ts +++ b/examples/multi-tenancy/src/multi-tenancy/actions/multi-tenancy-action.provider.ts @@ -3,8 +3,14 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {config, ContextTags, Getter, Provider} from '@loopback/context'; -import {extensionPoint, extensions} from '@loopback/core'; +import { + config, + ContextTags, + Getter, + Provider, + extensionPoint, + extensions, +} from '@loopback/core'; import {RequestContext} from '@loopback/rest'; import debugFactory from 'debug'; import {MultiTenancyBindings, MULTI_TENANCY_STRATEGIES} from '../keys'; diff --git a/examples/multi-tenancy/src/sequence.ts b/examples/multi-tenancy/src/sequence.ts index b67931a881af..1bce0fc1329d 100644 --- a/examples/multi-tenancy/src/sequence.ts +++ b/examples/multi-tenancy/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/multi-tenancy/tsconfig.json b/examples/multi-tenancy/tsconfig.json index 6c76a6abfbce..a4bb932c1d8b 100644 --- a/examples/multi-tenancy/tsconfig.json +++ b/examples/multi-tenancy/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/passport-login/package.json b/examples/passport-login/package.json index 921897b30127..8ed8d68ab6b9 100644 --- a/examples/passport-login/package.json +++ b/examples/passport-login/package.json @@ -40,7 +40,6 @@ "@loopback/authentication": "^4.2.6", "@loopback/authentication-passport": "^2.1.6", "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/express": "^1.2.2", "@loopback/openapi-v3": "^3.4.2", diff --git a/examples/passport-login/src/authentication-strategies/basic.ts b/examples/passport-login/src/authentication-strategies/basic.ts index 6eb752aa7354..966274c89d57 100644 --- a/examples/passport-login/src/authentication-strategies/basic.ts +++ b/examples/passport-login/src/authentication-strategies/basic.ts @@ -8,7 +8,7 @@ import {StrategyAdapter} from '@loopback/authentication-passport'; import {Request, RedirectRoute} from '@loopback/rest'; import {UserProfile} from '@loopback/security'; import {User} from '../models'; -import {bind} from '@loopback/context'; +import {bind} from '@loopback/core'; import {BasicStrategy as Strategy} from 'passport-http'; import {repository} from '@loopback/repository'; import {UserRepository} from '../repositories'; diff --git a/examples/passport-login/src/authentication-strategies/facebook.ts b/examples/passport-login/src/authentication-strategies/facebook.ts index e198b3d58274..ccf67b3596c5 100644 --- a/examples/passport-login/src/authentication-strategies/facebook.ts +++ b/examples/passport-login/src/authentication-strategies/facebook.ts @@ -6,8 +6,7 @@ import {asAuthStrategy, AuthenticationStrategy} from '@loopback/authentication'; import {StrategyAdapter} from '@loopback/authentication-passport'; import {Strategy} from 'passport-facebook'; -import {bind, inject} from '@loopback/context'; -import {extensionFor} from '@loopback/core'; +import {bind, inject, extensionFor} from '@loopback/core'; import {UserProfile} from '@loopback/security'; import {User} from '../models'; import {Request, RedirectRoute} from '@loopback/rest'; diff --git a/examples/passport-login/src/authentication-strategies/google.ts b/examples/passport-login/src/authentication-strategies/google.ts index 34e656b70e43..cb21bac63011 100644 --- a/examples/passport-login/src/authentication-strategies/google.ts +++ b/examples/passport-login/src/authentication-strategies/google.ts @@ -6,8 +6,7 @@ import {asAuthStrategy, AuthenticationStrategy} from '@loopback/authentication'; import {StrategyAdapter} from '@loopback/authentication-passport'; import {Strategy} from 'passport-google-oauth2'; -import {bind, inject} from '@loopback/context'; -import {extensionFor} from '@loopback/core'; +import {bind, inject, extensionFor} from '@loopback/core'; import {UserProfile} from '@loopback/security'; import {User} from '../models'; import {Request, RedirectRoute} from '@loopback/rest'; diff --git a/examples/passport-login/src/authentication-strategies/local.ts b/examples/passport-login/src/authentication-strategies/local.ts index 71e2cccaa2fa..752236b0b623 100644 --- a/examples/passport-login/src/authentication-strategies/local.ts +++ b/examples/passport-login/src/authentication-strategies/local.ts @@ -8,7 +8,7 @@ import {StrategyAdapter} from '@loopback/authentication-passport'; import {Request, RedirectRoute} from '@loopback/rest'; import {UserProfile, securityId} from '@loopback/security'; import {User} from '../models'; -import {bind} from '@loopback/context'; +import {bind} from '@loopback/core'; import {Strategy, IVerifyOptions} from 'passport-local'; import {repository} from '@loopback/repository'; import {UserRepository} from '../repositories'; diff --git a/examples/passport-login/src/authentication-strategies/session.ts b/examples/passport-login/src/authentication-strategies/session.ts index 9ac2caf12cd4..8dcffbf41571 100644 --- a/examples/passport-login/src/authentication-strategies/session.ts +++ b/examples/passport-login/src/authentication-strategies/session.ts @@ -7,7 +7,7 @@ import {AuthenticationStrategy, asAuthStrategy} from '@loopback/authentication'; import {RedirectRoute, RequestWithSession, HttpErrors} from '@loopback/rest'; import {UserProfile} from '@loopback/security'; import {User} from '../models'; -import {bind} from '@loopback/context'; +import {bind} from '@loopback/core'; import {repository} from '@loopback/repository'; import {UserRepository} from '../repositories'; import {mapProfile} from './types'; diff --git a/examples/passport-login/src/controllers/ping.controller.ts b/examples/passport-login/src/controllers/ping.controller.ts index ef2a1319f337..1208dc3a4e44 100644 --- a/examples/passport-login/src/controllers/ping.controller.ts +++ b/examples/passport-login/src/controllers/ping.controller.ts @@ -10,7 +10,7 @@ import { RequestBodyObject, SchemaObject, } from '@loopback/rest'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {authenticate} from '@loopback/authentication'; import {SecurityBindings, UserProfile} from '@loopback/security'; diff --git a/examples/passport-login/src/controllers/user.controller.ts b/examples/passport-login/src/controllers/user.controller.ts index 51c60f48edf0..879b7ce67d4d 100644 --- a/examples/passport-login/src/controllers/user.controller.ts +++ b/examples/passport-login/src/controllers/user.controller.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { post, del, diff --git a/examples/passport-login/src/sequence.ts b/examples/passport-login/src/sequence.ts index 52f9002ae077..95ecfe3ee524 100644 --- a/examples/passport-login/src/sequence.ts +++ b/examples/passport-login/src/sequence.ts @@ -9,7 +9,7 @@ import { AUTHENTICATION_STRATEGY_NOT_FOUND, USER_PROFILE_NOT_FOUND, } from '@loopback/authentication'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/passport-login/tsconfig.json b/examples/passport-login/tsconfig.json index 275267359e06..61f8ec695180 100644 --- a/examples/passport-login/tsconfig.json +++ b/examples/passport-login/tsconfig.json @@ -24,9 +24,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/rest-crud/package.json b/examples/rest-crud/package.json index 9f1ae406e4fa..fc0787890471 100644 --- a/examples/rest-crud/package.json +++ b/examples/rest-crud/package.json @@ -40,7 +40,6 @@ }, "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/rest-crud/src/sequence.ts b/examples/rest-crud/src/sequence.ts index cb6876c89904..b3e4deb4d89b 100644 --- a/examples/rest-crud/src/sequence.ts +++ b/examples/rest-crud/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/rest-crud/tsconfig.json b/examples/rest-crud/tsconfig.json index 11f44a417a1a..e05af391f484 100644 --- a/examples/rest-crud/tsconfig.json +++ b/examples/rest-crud/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/rpc-server/package.json b/examples/rpc-server/package.json index 2434d7dd0252..e0564442bdd0 100644 --- a/examples/rpc-server/package.json +++ b/examples/rpc-server/package.json @@ -41,7 +41,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "express": "^4.17.1", "tslib": "^2.0.0" diff --git a/examples/rpc-server/src/rpc.server.ts b/examples/rpc-server/src/rpc.server.ts index eaf36f0d811b..5f68e749b7a3 100644 --- a/examples/rpc-server/src/rpc.server.ts +++ b/examples/rpc-server/src/rpc.server.ts @@ -3,8 +3,13 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; -import {Application, CoreBindings, Server} from '@loopback/core'; +import { + Context, + inject, + Application, + CoreBindings, + Server, +} from '@loopback/core'; import {once} from 'events'; import express from 'express'; import http from 'http'; diff --git a/examples/rpc-server/tsconfig.json b/examples/rpc-server/tsconfig.json index 946d06dae6ef..c286e2aee8eb 100644 --- a/examples/rpc-server/tsconfig.json +++ b/examples/rpc-server/tsconfig.json @@ -11,9 +11,6 @@ "src/**/*.json" ], "references": [ - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/soap-calculator/package.json b/examples/soap-calculator/package.json index 1bbdd3742dfc..8a2d59dfe325 100644 --- a/examples/soap-calculator/package.json +++ b/examples/soap-calculator/package.json @@ -45,7 +45,6 @@ }, "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/soap-calculator/src/sequence.ts b/examples/soap-calculator/src/sequence.ts index 218043f7a735..bed39f6d44d3 100644 --- a/examples/soap-calculator/src/sequence.ts +++ b/examples/soap-calculator/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/soap-calculator/tsconfig.json b/examples/soap-calculator/tsconfig.json index 6c76a6abfbce..a4bb932c1d8b 100644 --- a/examples/soap-calculator/tsconfig.json +++ b/examples/soap-calculator/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/todo-jwt/package.json b/examples/todo-jwt/package.json index 2e63d0f49e7e..354c7886e5e2 100644 --- a/examples/todo-jwt/package.json +++ b/examples/todo-jwt/package.json @@ -42,7 +42,6 @@ "@loopback/authentication": "^4.2.6", "@loopback/authentication-jwt": "^0.4.0", "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/todo-jwt/src/sequence.ts b/examples/todo-jwt/src/sequence.ts index 977b0b2ef2c8..f026a940ffd8 100644 --- a/examples/todo-jwt/src/sequence.ts +++ b/examples/todo-jwt/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/todo-jwt/tsconfig.json b/examples/todo-jwt/tsconfig.json index 2d42de263958..b2cda2988898 100644 --- a/examples/todo-jwt/tsconfig.json +++ b/examples/todo-jwt/tsconfig.json @@ -20,9 +20,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/todo-list/package.json b/examples/todo-list/package.json index 4e4742dd2fac..79f1c5b23077 100644 --- a/examples/todo-list/package.json +++ b/examples/todo-list/package.json @@ -40,7 +40,6 @@ }, "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/todo-list/src/sequence.ts b/examples/todo-list/src/sequence.ts index d8a22e67a3b3..50aa89aef904 100644 --- a/examples/todo-list/src/sequence.ts +++ b/examples/todo-list/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/todo-list/tsconfig.json b/examples/todo-list/tsconfig.json index bda35b48f3a5..49d11fc02dfd 100644 --- a/examples/todo-list/tsconfig.json +++ b/examples/todo-list/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/todo/package.json b/examples/todo/package.json index 9992ef182f05..77d3eed55703 100644 --- a/examples/todo/package.json +++ b/examples/todo/package.json @@ -40,7 +40,6 @@ }, "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/todo/src/sequence.ts b/examples/todo/src/sequence.ts index db85cb4d7d17..d9fcca2dd243 100644 --- a/examples/todo/src/sequence.ts +++ b/examples/todo/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/examples/todo/tsconfig.json b/examples/todo/tsconfig.json index bda35b48f3a5..49d11fc02dfd 100644 --- a/examples/todo/tsconfig.json +++ b/examples/todo/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/examples/validation-app/package.json b/examples/validation-app/package.json index 62e089d2a874..cc2a3901a78b 100644 --- a/examples/validation-app/package.json +++ b/examples/validation-app/package.json @@ -42,7 +42,6 @@ }, "dependencies": { "@loopback/boot": "^2.3.2", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "@loopback/repository": "^2.6.0", diff --git a/examples/validation-app/src/interceptors/validate-phone-num.interceptor.ts b/examples/validation-app/src/interceptors/validate-phone-num.interceptor.ts index 53d30b548933..3d13f449fe60 100644 --- a/examples/validation-app/src/interceptors/validate-phone-num.interceptor.ts +++ b/examples/validation-app/src/interceptors/validate-phone-num.interceptor.ts @@ -10,7 +10,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; import {CoffeeShop} from '../models'; /** diff --git a/examples/validation-app/src/sequence.ts b/examples/validation-app/src/sequence.ts index 7b8f5b87e7ee..01d5319c24b4 100644 --- a/examples/validation-app/src/sequence.ts +++ b/examples/validation-app/src/sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, HttpErrors, diff --git a/examples/validation-app/tsconfig.json b/examples/validation-app/tsconfig.json index 6c76a6abfbce..a4bb932c1d8b 100644 --- a/examples/validation-app/tsconfig.json +++ b/examples/validation-app/tsconfig.json @@ -14,9 +14,6 @@ { "path": "../../packages/boot/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/extensions/apiconnect/package.json b/extensions/apiconnect/package.json index 742fb3381325..afad5ac7e3f5 100644 --- a/extensions/apiconnect/package.json +++ b/extensions/apiconnect/package.json @@ -39,7 +39,6 @@ "directory": "extensions/apiconnect" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/openapi-v3": "^3.4.2", "tslib": "^2.0.0" diff --git a/extensions/apiconnect/tsconfig.json b/extensions/apiconnect/tsconfig.json index 543536dc8b4e..d86749617e9a 100644 --- a/extensions/apiconnect/tsconfig.json +++ b/extensions/apiconnect/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/extensions/authentication-passport/package.json b/extensions/authentication-passport/package.json index a9613515948f..11026d569d7c 100644 --- a/extensions/authentication-passport/package.json +++ b/extensions/authentication-passport/package.json @@ -41,7 +41,6 @@ }, "dependencies": { "@loopback/authentication": "^4.2.6", - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/metadata": "^2.1.6", "@loopback/openapi-v3": "^3.4.2", diff --git a/extensions/authentication-passport/src/__tests__/acceptance/authentication-with-passport-strategy-adapter.acceptance.ts b/extensions/authentication-passport/src/__tests__/acceptance/authentication-with-passport-strategy-adapter.acceptance.ts index f4c9457d4c35..7b0d76461e90 100644 --- a/extensions/authentication-passport/src/__tests__/acceptance/authentication-with-passport-strategy-adapter.acceptance.ts +++ b/extensions/authentication-passport/src/__tests__/acceptance/authentication-with-passport-strategy-adapter.acceptance.ts @@ -13,8 +13,7 @@ import { UserProfileFactory, USER_PROFILE_NOT_FOUND, } from '@loopback/authentication'; -import {inject} from '@loopback/context'; -import {addExtension, CoreTags, Provider} from '@loopback/core'; +import {inject, addExtension, CoreTags, Provider} from '@loopback/core'; import {anOpenApiSpec} from '@loopback/openapi-spec-builder'; import {api, get} from '@loopback/openapi-v3'; import { diff --git a/extensions/authentication-passport/src/__tests__/acceptance/fixtures/simple-rest-app.ts b/extensions/authentication-passport/src/__tests__/acceptance/fixtures/simple-rest-app.ts index bd2eac3bbe91..f0f698803de2 100644 --- a/extensions/authentication-passport/src/__tests__/acceptance/fixtures/simple-rest-app.ts +++ b/extensions/authentication-passport/src/__tests__/acceptance/fixtures/simple-rest-app.ts @@ -8,7 +8,7 @@ import { AuthenticationBindings, AuthenticationComponent, } from '@loopback/authentication'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/extensions/authentication-passport/tsconfig.json b/extensions/authentication-passport/tsconfig.json index 6c32e81e5acf..ded5a6d3a0b2 100644 --- a/extensions/authentication-passport/tsconfig.json +++ b/extensions/authentication-passport/tsconfig.json @@ -16,9 +16,6 @@ { "path": "../../packages/authentication/tsconfig.json" }, - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/extensions/context-explorer/package.json b/extensions/context-explorer/package.json index 00f73fcc9b35..a6e7ae06a444 100644 --- a/extensions/context-explorer/package.json +++ b/extensions/context-explorer/package.json @@ -21,7 +21,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/rest": "^5.1.0", "ts-graphviz": "^0.13.1", diff --git a/extensions/context-explorer/src/__tests__/integration/context-graph.integration.ts b/extensions/context-explorer/src/__tests__/integration/context-graph.integration.ts index 880bc29f54b8..a3a1e14d40d7 100644 --- a/extensions/context-explorer/src/__tests__/integration/context-graph.integration.ts +++ b/extensions/context-explorer/src/__tests__/integration/context-graph.integration.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; import {expect} from '@loopback/testlab'; import {ContextGraph} from '../..'; diff --git a/extensions/context-explorer/src/__tests__/integration/visualizer.integration.ts b/extensions/context-explorer/src/__tests__/integration/visualizer.integration.ts index a727a1d7c146..87f2721f693a 100644 --- a/extensions/context-explorer/src/__tests__/integration/visualizer.integration.ts +++ b/extensions/context-explorer/src/__tests__/integration/visualizer.integration.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import {expect} from '@loopback/testlab'; import {ContextGraph} from '../..'; import {renderGraph} from '../../visualizer'; diff --git a/extensions/context-explorer/src/context-explorer.component.ts b/extensions/context-explorer/src/context-explorer.component.ts index 7fc4208d3cdb..5aac5cfa616a 100644 --- a/extensions/context-explorer/src/context-explorer.component.ts +++ b/extensions/context-explorer/src/context-explorer.component.ts @@ -3,9 +3,15 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import {bind, config, ContextTags, inject} from '@loopback/context'; -import {Component, CoreBindings} from '@loopback/core'; +import { + bind, + Component, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + config, + ContextTags, + CoreBindings, + inject, +} from '@loopback/core'; import {RestApplication} from '@loopback/rest'; import path from 'path'; import {contextExplorerControllerFactory} from './context-explorer.controller'; diff --git a/extensions/context-explorer/src/context-explorer.controller.ts b/extensions/context-explorer/src/context-explorer.controller.ts index 97e2d3b870dd..2426055a2c2c 100644 --- a/extensions/context-explorer/src/context-explorer.controller.ts +++ b/extensions/context-explorer/src/context-explorer.controller.ts @@ -4,13 +4,7 @@ // License text available at https://opensource.org/licenses/MIT /* eslint-disable @typescript-eslint/no-unused-vars */ -import { - config, - Constructor, - Context, - inject, - JSONObject, -} from '@loopback/context'; +import {config, Constructor, Context, inject, JSONObject} from '@loopback/core'; import { api, get, diff --git a/extensions/context-explorer/src/context-graph.ts b/extensions/context-explorer/src/context-graph.ts index acdf1690b2cf..71118bc225e5 100644 --- a/extensions/context-explorer/src/context-graph.ts +++ b/extensions/context-explorer/src/context-graph.ts @@ -3,12 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { - BindingScope, - ContextTags, - JSONArray, - JSONObject, -} from '@loopback/context'; +import {BindingScope, ContextTags, JSONArray, JSONObject} from '@loopback/core'; import {attribute, Digraph, ICluster, toDot, INode, IEdge} from 'ts-graphviz'; /** diff --git a/extensions/context-explorer/src/keys.ts b/extensions/context-explorer/src/keys.ts index bab61cd91648..e7225f05187b 100644 --- a/extensions/context-explorer/src/keys.ts +++ b/extensions/context-explorer/src/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; import {ContextExplorerComponent} from './context-explorer.component'; /** diff --git a/extensions/context-explorer/tsconfig.json b/extensions/context-explorer/tsconfig.json index cae293364492..bdd4f3eb6b2a 100644 --- a/extensions/context-explorer/tsconfig.json +++ b/extensions/context-explorer/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/extensions/logging/package.json b/extensions/logging/package.json index 2897700ad72e..6f2a83570389 100644 --- a/extensions/logging/package.json +++ b/extensions/logging/package.json @@ -21,7 +21,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/rest": "^5.1.0", "fluent-logger": "^3.4.1", diff --git a/extensions/logging/src/__tests__/acceptance/winston.acceptance.ts b/extensions/logging/src/__tests__/acceptance/winston.acceptance.ts index 19bbcdff6421..d429724bf144 100644 --- a/extensions/logging/src/__tests__/acceptance/winston.acceptance.ts +++ b/extensions/logging/src/__tests__/acceptance/winston.acceptance.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; -import {extensionFor} from '@loopback/core'; +import {Context, extensionFor} from '@loopback/core'; import {expect} from '@loopback/testlab'; import { format, diff --git a/extensions/logging/src/decorators/logging.decorator.ts b/extensions/logging/src/decorators/logging.decorator.ts index 43a41e355126..74c49182cd19 100644 --- a/extensions/logging/src/decorators/logging.decorator.ts +++ b/extensions/logging/src/decorators/logging.decorator.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {intercept} from '@loopback/context'; +import {intercept} from '@loopback/core'; import {LoggingBindings} from '../keys'; /** diff --git a/extensions/logging/src/interceptors/logging.interceptor.ts b/extensions/logging/src/interceptors/logging.interceptor.ts index 63096f3e28d7..aae56cc02f3b 100644 --- a/extensions/logging/src/interceptors/logging.interceptor.ts +++ b/extensions/logging/src/interceptors/logging.interceptor.ts @@ -14,7 +14,7 @@ import { InvocationContext, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; import {RequestContext, RestBindings} from '@loopback/rest'; import morgan from 'morgan'; import {format} from 'util'; diff --git a/extensions/logging/tsconfig.json b/extensions/logging/tsconfig.json index cae293364492..bdd4f3eb6b2a 100644 --- a/extensions/logging/tsconfig.json +++ b/extensions/logging/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/extensions/metrics/package.json b/extensions/metrics/package.json index 93d38f54c9b9..602569798c2f 100644 --- a/extensions/metrics/package.json +++ b/extensions/metrics/package.json @@ -21,7 +21,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/rest": "^5.1.0", "prom-client": "^12.0.0", diff --git a/extensions/metrics/src/interceptors/metrics.interceptor.ts b/extensions/metrics/src/interceptors/metrics.interceptor.ts index a1cab5fd593d..de3c8c900f4c 100644 --- a/extensions/metrics/src/interceptors/metrics.interceptor.ts +++ b/extensions/metrics/src/interceptors/metrics.interceptor.ts @@ -11,7 +11,7 @@ import { InvocationContext, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; import {Counter, Gauge, Histogram, register, Summary} from 'prom-client'; /** diff --git a/extensions/metrics/src/keys.ts b/extensions/metrics/src/keys.ts index 303ce893094e..2801e439c5a3 100644 --- a/extensions/metrics/src/keys.ts +++ b/extensions/metrics/src/keys.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +import {BindingKey, CoreBindings} from '@loopback/core'; import {MetricsComponent} from './metrics.component'; /** diff --git a/extensions/metrics/src/metrics.component.ts b/extensions/metrics/src/metrics.component.ts index 6e521122976e..ea98d60ba1f5 100644 --- a/extensions/metrics/src/metrics.component.ts +++ b/extensions/metrics/src/metrics.component.ts @@ -4,14 +4,16 @@ // License text available at https://opensource.org/licenses/MIT import { + Application, bind, + Component, // eslint-disable-next-line @typescript-eslint/no-unused-vars config, ContextTags, + CoreBindings, createBindingFromClass, inject, -} from '@loopback/context'; -import {Application, Component, CoreBindings} from '@loopback/core'; +} from '@loopback/core'; import {metricsControllerFactory} from './controllers'; import {MetricsInterceptor} from './interceptors'; import {MetricsBindings} from './keys'; diff --git a/extensions/metrics/tsconfig.json b/extensions/metrics/tsconfig.json index cae293364492..bdd4f3eb6b2a 100644 --- a/extensions/metrics/tsconfig.json +++ b/extensions/metrics/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../../packages/context/tsconfig.json" - }, { "path": "../../packages/core/tsconfig.json" }, diff --git a/packages/authentication/package.json b/packages/authentication/package.json index ba2a73ba19b1..84f7a7039b30 100644 --- a/packages/authentication/package.json +++ b/packages/authentication/package.json @@ -24,7 +24,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/metadata": "^2.1.6", "@loopback/openapi-v3": "^3.4.2", diff --git a/packages/authentication/src/__tests__/acceptance/basic-auth-extension.acceptance.ts b/packages/authentication/src/__tests__/acceptance/basic-auth-extension.acceptance.ts index 730c4e8f67dc..cf3934f7d2eb 100644 --- a/packages/authentication/src/__tests__/acceptance/basic-auth-extension.acceptance.ts +++ b/packages/authentication/src/__tests__/acceptance/basic-auth-extension.acceptance.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; -import {Application} from '@loopback/core'; +import {inject, Application} from '@loopback/core'; import {anOpenApiSpec} from '@loopback/openapi-spec-builder'; import {api, get} from '@loopback/openapi-v3'; import {Request, RestServer} from '@loopback/rest'; diff --git a/packages/authentication/src/__tests__/acceptance/jwt-auth-extension.acceptance.ts b/packages/authentication/src/__tests__/acceptance/jwt-auth-extension.acceptance.ts index 83b52261c202..7503e961b523 100644 --- a/packages/authentication/src/__tests__/acceptance/jwt-auth-extension.acceptance.ts +++ b/packages/authentication/src/__tests__/acceptance/jwt-auth-extension.acceptance.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; -import {Application} from '@loopback/core'; +import {inject, Application} from '@loopback/core'; import {get, post} from '@loopback/openapi-v3'; import {Request, RestServer} from '@loopback/rest'; import {SecurityBindings, securityId, UserProfile} from '@loopback/security'; diff --git a/packages/authentication/src/__tests__/fixtures/keys.ts b/packages/authentication/src/__tests__/fixtures/keys.ts index 434c161777e7..0452ed696387 100644 --- a/packages/authentication/src/__tests__/fixtures/keys.ts +++ b/packages/authentication/src/__tests__/fixtures/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; import {BasicAuthenticationUserService} from './services/basic-auth-user-service'; import {JWTService} from './services/jwt-service'; import {UserRepository} from './users/user.repository'; diff --git a/packages/authentication/src/__tests__/fixtures/sequences/authentication.sequence.ts b/packages/authentication/src/__tests__/fixtures/sequences/authentication.sequence.ts index d1650a5940da..00bdceeb7dae 100644 --- a/packages/authentication/src/__tests__/fixtures/sequences/authentication.sequence.ts +++ b/packages/authentication/src/__tests__/fixtures/sequences/authentication.sequence.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/packages/authentication/src/__tests__/fixtures/services/basic-auth-user-service.ts b/packages/authentication/src/__tests__/fixtures/services/basic-auth-user-service.ts index 3b4f0e60a21f..7faac90266ce 100644 --- a/packages/authentication/src/__tests__/fixtures/services/basic-auth-user-service.ts +++ b/packages/authentication/src/__tests__/fixtures/services/basic-auth-user-service.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {HttpErrors} from '@loopback/rest'; import {UserProfile} from '@loopback/security'; import {AuthenticationBindings} from '../../../'; diff --git a/packages/authentication/src/__tests__/fixtures/services/jwt-service.ts b/packages/authentication/src/__tests__/fixtures/services/jwt-service.ts index 5f523a3ad40f..5fc8cc36f155 100644 --- a/packages/authentication/src/__tests__/fixtures/services/jwt-service.ts +++ b/packages/authentication/src/__tests__/fixtures/services/jwt-service.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {HttpErrors} from '@loopback/rest'; import {securityId, UserProfile} from '@loopback/security'; import {promisify} from 'util'; diff --git a/packages/authentication/src/__tests__/fixtures/strategies/basic-strategy.ts b/packages/authentication/src/__tests__/fixtures/strategies/basic-strategy.ts index 63ce2bac2a1c..3010791100a1 100644 --- a/packages/authentication/src/__tests__/fixtures/strategies/basic-strategy.ts +++ b/packages/authentication/src/__tests__/fixtures/strategies/basic-strategy.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {bind, inject} from '@loopback/context'; +import {bind, inject} from '@loopback/core'; import { asSpecEnhancer, mergeSecuritySchemeToSpec, diff --git a/packages/authentication/src/__tests__/fixtures/strategies/jwt-strategy.ts b/packages/authentication/src/__tests__/fixtures/strategies/jwt-strategy.ts index 5b0db60adfde..8f0caf1ddc3f 100644 --- a/packages/authentication/src/__tests__/fixtures/strategies/jwt-strategy.ts +++ b/packages/authentication/src/__tests__/fixtures/strategies/jwt-strategy.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {bind, inject} from '@loopback/context'; +import {bind, inject} from '@loopback/core'; import { asSpecEnhancer, mergeSecuritySchemeToSpec, diff --git a/packages/authentication/src/__tests__/unit/providers/auth-metadata.provider.unit.ts b/packages/authentication/src/__tests__/unit/providers/auth-metadata.provider.unit.ts index 986b2f11534a..b56bedf037b2 100644 --- a/packages/authentication/src/__tests__/unit/providers/auth-metadata.provider.unit.ts +++ b/packages/authentication/src/__tests__/unit/providers/auth-metadata.provider.unit.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, Provider} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +import {Context, Provider, CoreBindings} from '@loopback/core'; import {expect} from '@loopback/testlab'; import {authenticate, AuthenticationMetadata} from '../../..'; import {AuthenticationBindings} from '../../../keys'; diff --git a/packages/authentication/src/__tests__/unit/providers/authentication.provider.unit.ts b/packages/authentication/src/__tests__/unit/providers/authentication.provider.unit.ts index ca20b4c03104..5114dd5d1154 100644 --- a/packages/authentication/src/__tests__/unit/providers/authentication.provider.unit.ts +++ b/packages/authentication/src/__tests__/unit/providers/authentication.provider.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, instantiateClass} from '@loopback/context'; +import {Context, instantiateClass} from '@loopback/core'; import {Request} from '@loopback/rest'; import {securityId, UserProfile} from '@loopback/security'; import {expect} from '@loopback/testlab'; diff --git a/packages/authentication/src/__tests__/unit/types/register-authentication-strategy.unit.ts b/packages/authentication/src/__tests__/unit/types/register-authentication-strategy.unit.ts index 9435236a4154..bd65b9ea4f7a 100644 --- a/packages/authentication/src/__tests__/unit/types/register-authentication-strategy.unit.ts +++ b/packages/authentication/src/__tests__/unit/types/register-authentication-strategy.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {bind, Context, createBindingFromClass} from '@loopback/context'; +import {bind, Context, createBindingFromClass} from '@loopback/core'; import { asSpecEnhancer, OASEnhancer, diff --git a/packages/authentication/src/decorators/authenticate.decorator.ts b/packages/authentication/src/decorators/authenticate.decorator.ts index 03fb8a1a6716..82a789779dfb 100644 --- a/packages/authentication/src/decorators/authenticate.decorator.ts +++ b/packages/authentication/src/decorators/authenticate.decorator.ts @@ -9,7 +9,7 @@ import { DecoratorFactory, MetadataInspector, MethodDecoratorFactory, -} from '@loopback/context'; +} from '@loopback/core'; import { AUTHENTICATION_METADATA_CLASS_KEY, AUTHENTICATION_METADATA_KEY, diff --git a/packages/authentication/src/keys.ts b/packages/authentication/src/keys.ts index 782862d90e43..28f1bb7e55fa 100644 --- a/packages/authentication/src/keys.ts +++ b/packages/authentication/src/keys.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; -import {MetadataAccessor} from '@loopback/metadata'; +import {BindingKey, MetadataAccessor} from '@loopback/core'; import {SecurityBindings, UserProfile} from '@loopback/security'; import {AuthenticationComponent} from './authentication.component'; import { diff --git a/packages/authentication/src/providers/auth-action.provider.ts b/packages/authentication/src/providers/auth-action.provider.ts index 413fe863bf3a..40e54f0fbbfe 100644 --- a/packages/authentication/src/providers/auth-action.provider.ts +++ b/packages/authentication/src/providers/auth-action.provider.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter, inject, Provider, Setter} from '@loopback/context'; +import {Getter, inject, Provider, Setter} from '@loopback/core'; import {Request, RedirectRoute} from '@loopback/rest'; import {SecurityBindings, UserProfile} from '@loopback/security'; import {AuthenticationBindings} from '../keys'; diff --git a/packages/authentication/src/providers/auth-metadata.provider.ts b/packages/authentication/src/providers/auth-metadata.provider.ts index 33f020d320f2..5df7d5d3d6cb 100644 --- a/packages/authentication/src/providers/auth-metadata.provider.ts +++ b/packages/authentication/src/providers/auth-metadata.provider.ts @@ -3,8 +3,13 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {config, Constructor, inject, Provider} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +import { + config, + Constructor, + inject, + Provider, + CoreBindings, +} from '@loopback/core'; import {getAuthenticateMetadata} from '../decorators'; import {AuthenticationBindings} from '../keys'; import {AuthenticationMetadata, AuthenticationOptions} from '../types'; diff --git a/packages/authentication/src/providers/auth-strategy.provider.ts b/packages/authentication/src/providers/auth-strategy.provider.ts index 99d18d9a98a0..cad90ec45a23 100644 --- a/packages/authentication/src/providers/auth-strategy.provider.ts +++ b/packages/authentication/src/providers/auth-strategy.provider.ts @@ -3,8 +3,14 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingScope, Getter, inject} from '@loopback/context'; -import {extensionPoint, extensions, Provider} from '@loopback/core'; +import { + BindingScope, + Getter, + inject, + extensionPoint, + extensions, + Provider, +} from '@loopback/core'; import {AuthenticationBindings} from '../keys'; import { AuthenticationMetadata, diff --git a/packages/authentication/tsconfig.json b/packages/authentication/tsconfig.json index b7625cfb61a7..fc86c35cd460 100644 --- a/packages/authentication/tsconfig.json +++ b/packages/authentication/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" }, diff --git a/packages/authorization/package.json b/packages/authorization/package.json index cef695737db9..c39a0ebbb4fa 100644 --- a/packages/authorization/package.json +++ b/packages/authorization/package.json @@ -24,7 +24,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/security": "^0.2.11", "debug": "^4.1.1", diff --git a/packages/authorization/src/__tests__/acceptance/authorization-casbin.acceptance.ts b/packages/authorization/src/__tests__/acceptance/authorization-casbin.acceptance.ts index 2ed90d4d264e..cde0e9b2e820 100644 --- a/packages/authorization/src/__tests__/acceptance/authorization-casbin.acceptance.ts +++ b/packages/authorization/src/__tests__/acceptance/authorization-casbin.acceptance.ts @@ -3,8 +3,13 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject, invokeMethod, Provider} from '@loopback/context'; -import {Application} from '@loopback/core'; +import { + Context, + inject, + invokeMethod, + Provider, + Application, +} from '@loopback/core'; import {SecurityBindings, securityId, UserProfile} from '@loopback/security'; import {expect} from '@loopback/testlab'; import * as casbin from 'casbin'; diff --git a/packages/authorization/src/__tests__/acceptance/authorization.acceptance.ts b/packages/authorization/src/__tests__/acceptance/authorization.acceptance.ts index aca48840cf17..c3dfbe684088 100644 --- a/packages/authorization/src/__tests__/acceptance/authorization.acceptance.ts +++ b/packages/authorization/src/__tests__/acceptance/authorization.acceptance.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, invokeMethod, Provider} from '@loopback/context'; -import {Application} from '@loopback/core'; +import {Context, invokeMethod, Provider, Application} from '@loopback/core'; import {SecurityBindings, securityId} from '@loopback/security'; import {expect} from '@loopback/testlab'; import { diff --git a/packages/authorization/src/__tests__/acceptance/authorization.options.acceptance.ts b/packages/authorization/src/__tests__/acceptance/authorization.options.acceptance.ts index 99a8cd4923ba..61e002a5e96d 100644 --- a/packages/authorization/src/__tests__/acceptance/authorization.options.acceptance.ts +++ b/packages/authorization/src/__tests__/acceptance/authorization.options.acceptance.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, invokeMethod, Provider} from '@loopback/context'; -import {Application} from '@loopback/core'; +import {Context, invokeMethod, Provider, Application} from '@loopback/core'; import {SecurityBindings, securityId} from '@loopback/security'; import {expect} from '@loopback/testlab'; import {AuthorizationComponent} from '../../authorization-component'; diff --git a/packages/authorization/src/authorize-interceptor.ts b/packages/authorization/src/authorize-interceptor.ts index 404c57ded3e3..5bdeec83f0c6 100644 --- a/packages/authorization/src/authorize-interceptor.ts +++ b/packages/authorization/src/authorize-interceptor.ts @@ -15,7 +15,7 @@ import { Next, NonVoid, Provider, -} from '@loopback/context'; +} from '@loopback/core'; import {SecurityBindings, UserProfile} from '@loopback/security'; import debugFactory from 'debug'; import {getAuthorizationMetadata} from './decorators/authorize'; diff --git a/packages/authorization/src/decorators/authorize.ts b/packages/authorization/src/decorators/authorize.ts index 7aeb6461402e..6af1ca4b6e64 100644 --- a/packages/authorization/src/decorators/authorize.ts +++ b/packages/authorization/src/decorators/authorize.ts @@ -11,7 +11,7 @@ import { MetadataInspector, MetadataMap, MethodDecoratorFactory, -} from '@loopback/context'; +} from '@loopback/core'; import { AUTHENTICATED, AuthorizationMetadata, diff --git a/packages/authorization/src/types.ts b/packages/authorization/src/types.ts index 370a1e67e8d1..c22582076735 100644 --- a/packages/authorization/src/types.ts +++ b/packages/authorization/src/types.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingAddress, InvocationContext} from '@loopback/context'; +import {BindingAddress, InvocationContext} from '@loopback/core'; import {Principal, Role} from '@loopback/security'; /** diff --git a/packages/authorization/tsconfig.json b/packages/authorization/tsconfig.json index 160f59d4e345..c3711b702251 100644 --- a/packages/authorization/tsconfig.json +++ b/packages/authorization/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" }, diff --git a/packages/boot/package.json b/packages/boot/package.json index 67bc48d3eb62..bd781396fba5 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -24,7 +24,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/model-api-builder": "^2.1.6", "@loopback/repository": "^2.6.0", diff --git a/packages/boot/src/__tests__/fixtures/interceptor.artifact.ts b/packages/boot/src/__tests__/fixtures/interceptor.artifact.ts index 32b9ef5f9f80..4d871b1644ce 100644 --- a/packages/boot/src/__tests__/fixtures/interceptor.artifact.ts +++ b/packages/boot/src/__tests__/fixtures/interceptor.artifact.ts @@ -10,7 +10,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as a global `Interceptor` during diff --git a/packages/boot/src/__tests__/fixtures/non-global-interceptor.artifact.ts b/packages/boot/src/__tests__/fixtures/non-global-interceptor.artifact.ts index 20aac6b26ca3..5e2af7492a52 100644 --- a/packages/boot/src/__tests__/fixtures/non-global-interceptor.artifact.ts +++ b/packages/boot/src/__tests__/fixtures/non-global-interceptor.artifact.ts @@ -10,7 +10,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as a global `Interceptor` during diff --git a/packages/boot/src/boot.component.ts b/packages/boot/src/boot.component.ts index bca7fdd20543..19b4b1b92387 100644 --- a/packages/boot/src/boot.component.ts +++ b/packages/boot/src/boot.component.ts @@ -3,8 +3,13 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingScope, inject} from '@loopback/context'; -import {Application, Component, CoreBindings} from '@loopback/core'; +import { + BindingScope, + inject, + Application, + Component, + CoreBindings, +} from '@loopback/core'; import { ApplicationMetadataBooter, ControllerBooter, diff --git a/packages/boot/src/booters/application-metadata.booter.ts b/packages/boot/src/booters/application-metadata.booter.ts index 5bc8d88f76c9..45cdfafc0988 100644 --- a/packages/boot/src/booters/application-metadata.booter.ts +++ b/packages/boot/src/booters/application-metadata.booter.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; -import {Application, CoreBindings} from '@loopback/core'; +import {inject, Application, CoreBindings} from '@loopback/core'; import debugModule from 'debug'; import {BootBindings} from '../keys'; import {Booter} from '../types'; diff --git a/packages/boot/src/booters/base-artifact.booter.ts b/packages/boot/src/booters/base-artifact.booter.ts index 1078e4feb164..88e535ad43ee 100644 --- a/packages/boot/src/booters/base-artifact.booter.ts +++ b/packages/boot/src/booters/base-artifact.booter.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Constructor} from '@loopback/context'; +import {Constructor} from '@loopback/core'; import debugFactory from 'debug'; import path from 'path'; import {ArtifactOptions, Booter} from '../types'; diff --git a/packages/boot/src/booters/booter-utils.ts b/packages/boot/src/booters/booter-utils.ts index 724a1d2a6359..ca232b62b7ec 100644 --- a/packages/boot/src/booters/booter-utils.ts +++ b/packages/boot/src/booters/booter-utils.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Constructor} from '@loopback/context'; +import {Constructor} from '@loopback/core'; import debugFactory from 'debug'; import path from 'path'; import {promisify} from 'util'; diff --git a/packages/boot/src/booters/controller.booter.ts b/packages/boot/src/booters/controller.booter.ts index 7eeed3f5f27b..334782ec1a10 100644 --- a/packages/boot/src/booters/controller.booter.ts +++ b/packages/boot/src/booters/controller.booter.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {config, inject} from '@loopback/context'; -import {Application, CoreBindings} from '@loopback/core'; +import {config, inject, Application, CoreBindings} from '@loopback/core'; import {BootBindings} from '../keys'; import {ArtifactOptions, booter} from '../types'; import {BaseArtifactBooter} from './base-artifact.booter'; diff --git a/packages/boot/src/booters/datasource.booter.ts b/packages/boot/src/booters/datasource.booter.ts index 336119daa2a9..d8e05835bbb7 100644 --- a/packages/boot/src/booters/datasource.booter.ts +++ b/packages/boot/src/booters/datasource.booter.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {config, inject} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +import {config, inject, CoreBindings} from '@loopback/core'; import { ApplicationWithRepositories, Class, diff --git a/packages/boot/src/booters/interceptor.booter.ts b/packages/boot/src/booters/interceptor.booter.ts index 207def828855..12960eb89ac2 100644 --- a/packages/boot/src/booters/interceptor.booter.ts +++ b/packages/boot/src/booters/interceptor.booter.ts @@ -4,13 +4,14 @@ // License text available at https://opensource.org/licenses/MIT import { + Application, config, Constructor, + CoreBindings, inject, Interceptor, Provider, -} from '@loopback/context'; -import {Application, CoreBindings} from '@loopback/core'; +} from '@loopback/core'; import debugFactory from 'debug'; import {BootBindings} from '../keys'; import {ArtifactOptions, booter} from '../types'; diff --git a/packages/boot/src/booters/lifecyle-observer.booter.ts b/packages/boot/src/booters/lifecyle-observer.booter.ts index 49383a0c6182..6cdf9b824ea7 100644 --- a/packages/boot/src/booters/lifecyle-observer.booter.ts +++ b/packages/boot/src/booters/lifecyle-observer.booter.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {config, Constructor, inject} from '@loopback/context'; +import {config, Constructor, inject} from '@loopback/core'; import { Application, CoreBindings, diff --git a/packages/boot/src/booters/model.booter.ts b/packages/boot/src/booters/model.booter.ts index 12e9814eeb91..df23cc408b35 100644 --- a/packages/boot/src/booters/model.booter.ts +++ b/packages/boot/src/booters/model.booter.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {config, Constructor, inject} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +import {config, Constructor, inject, CoreBindings} from '@loopback/core'; import { ApplicationWithRepositories, ModelMetadataHelper, diff --git a/packages/boot/src/booters/repository.booter.ts b/packages/boot/src/booters/repository.booter.ts index 9ec694f2a58c..35dc5f748e20 100644 --- a/packages/boot/src/booters/repository.booter.ts +++ b/packages/boot/src/booters/repository.booter.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {config, inject} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +import {config, inject, CoreBindings} from '@loopback/core'; import {ApplicationWithRepositories} from '@loopback/repository'; import {BootBindings} from '../keys'; import {ArtifactOptions, booter} from '../types'; diff --git a/packages/boot/src/booters/service.booter.ts b/packages/boot/src/booters/service.booter.ts index bd0efb38b1ca..8dc2f626fb45 100644 --- a/packages/boot/src/booters/service.booter.ts +++ b/packages/boot/src/booters/service.booter.ts @@ -7,10 +7,10 @@ import { BINDING_METADATA_KEY, config, Constructor, + CoreBindings, inject, MetadataInspector, -} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +} from '@loopback/core'; import {ApplicationWithServices} from '@loopback/service-proxy'; import debugFactory from 'debug'; import {BootBindings} from '../keys'; diff --git a/packages/boot/src/bootstrapper.ts b/packages/boot/src/bootstrapper.ts index 9d891534584c..a7e4baa22d69 100644 --- a/packages/boot/src/bootstrapper.ts +++ b/packages/boot/src/bootstrapper.ts @@ -3,8 +3,13 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject, resolveList} from '@loopback/context'; -import {Application, CoreBindings} from '@loopback/core'; +import { + Context, + inject, + resolveList, + Application, + CoreBindings, +} from '@loopback/core'; import debugModule from 'debug'; import {resolve} from 'path'; import {BootBindings, BootTags} from './keys'; diff --git a/packages/boot/src/keys.ts b/packages/boot/src/keys.ts index ab242c8cc64b..eb8e8ea6eed8 100644 --- a/packages/boot/src/keys.ts +++ b/packages/boot/src/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; import {Bootstrapper} from './bootstrapper'; import {BootOptions} from './types'; diff --git a/packages/boot/src/mixins/boot.mixin.ts b/packages/boot/src/mixins/boot.mixin.ts index 5b410ed72b3e..5b671a1c839e 100644 --- a/packages/boot/src/mixins/boot.mixin.ts +++ b/packages/boot/src/mixins/boot.mixin.ts @@ -11,7 +11,7 @@ import { Constructor, Context, createBindingFromClass, -} from '@loopback/context'; +} from '@loopback/core'; import { Application, Component, @@ -26,7 +26,7 @@ import {Bootable, Booter, BootOptions, InstanceWithBooters} from '../types'; // FIXME(rfeng): Workaround for https://github.com/microsoft/rushstack/pull/1867 /* eslint-disable @typescript-eslint/no-unused-vars */ -import * as loopbackContext from '@loopback/context'; +import * as loopbackContext from '@loopback/core'; import * as loopbackCore from '@loopback/core'; /* eslint-enable @typescript-eslint/no-unused-vars */ diff --git a/packages/boot/src/types.ts b/packages/boot/src/types.ts index 73c0e6dc010a..c0643f4525aa 100644 --- a/packages/boot/src/types.ts +++ b/packages/boot/src/types.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {bind, Binding, BindingSpec, Constructor} from '@loopback/context'; +import {bind, Binding, BindingSpec, Constructor} from '@loopback/core'; import {BootTags} from './keys'; /** diff --git a/packages/boot/tsconfig.json b/packages/boot/tsconfig.json index 0be72dad5dd9..8c3eee450c18 100644 --- a/packages/boot/tsconfig.json +++ b/packages/boot/tsconfig.json @@ -11,9 +11,6 @@ "src/**/*.json" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" }, diff --git a/packages/cli/generators/app/templates/src/controllers/ping.controller.ts.ejs b/packages/cli/generators/app/templates/src/controllers/ping.controller.ts.ejs index 5e945cb4496e..f8be13b7d943 100644 --- a/packages/cli/generators/app/templates/src/controllers/ping.controller.ts.ejs +++ b/packages/cli/generators/app/templates/src/controllers/ping.controller.ts.ejs @@ -1,5 +1,5 @@ import {Request, RestBindings, get, ResponseObject} from '@loopback/rest'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; /** * OpenAPI response for ping() diff --git a/packages/cli/generators/app/templates/src/sequence.ts.ejs b/packages/cli/generators/app/templates/src/sequence.ts.ejs index e99e267a51e5..f564ebcfe84d 100644 --- a/packages/cli/generators/app/templates/src/sequence.ts.ejs +++ b/packages/cli/generators/app/templates/src/sequence.ts.ejs @@ -1,4 +1,4 @@ -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { FindRoute, InvokeMethod, diff --git a/packages/cli/generators/controller/templates/src/controllers/controller-template.ts.ejs b/packages/cli/generators/controller/templates/src/controllers/controller-template.ts.ejs index 3875c5098741..4300d4a0381d 100644 --- a/packages/cli/generators/controller/templates/src/controllers/controller-template.ts.ejs +++ b/packages/cli/generators/controller/templates/src/controllers/controller-template.ts.ejs @@ -1,6 +1,6 @@ // Uncomment these imports to begin using these cool features! -// import {inject} from '@loopback/context'; +// import {inject} from '@loopback/core'; export class <%= className %>Controller { diff --git a/packages/cli/generators/interceptor/templates/interceptor-template.ts.ejs b/packages/cli/generators/interceptor/templates/interceptor-template.ts.ejs index 046d428dc263..670a9e342afd 100644 --- a/packages/cli/generators/interceptor/templates/interceptor-template.ts.ejs +++ b/packages/cli/generators/interceptor/templates/interceptor-template.ts.ejs @@ -10,7 +10,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as an `Interceptor` during diff --git a/packages/cli/generators/project/templates/package.json.ejs b/packages/cli/generators/project/templates/package.json.ejs index 795774189e9c..ffcc41d10f2e 100644 --- a/packages/cli/generators/project/templates/package.json.ejs +++ b/packages/cli/generators/project/templates/package.json.ejs @@ -73,9 +73,8 @@ ], "dependencies": { "@loopback/boot": "<%= project.dependencies['@loopback/boot'] -%>", - "@loopback/context": "<%= project.dependencies['@loopback/context'] -%>", -<% if (project.projectType === 'application') { -%> "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>", +<% if (project.projectType === 'application') { -%> "@loopback/openapi-v3": "<%= project.dependencies['@loopback/openapi-v3'] -%>", <% if (project.repositories) { -%> "@loopback/repository": "<%= project.dependencies['@loopback/repository'] -%>", @@ -90,8 +89,6 @@ <% } else { -%> "@loopback/rest-explorer": "<%= project.dependencies['@loopback/rest-explorer'] -%>", <% } -%> -<% } else { /* NOT AN APPLICATION */-%> - "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>", <% } -%> "tslib": "<%= project.dependencies['tslib'] -%>" }, diff --git a/packages/cli/generators/project/templates/package.plain.json.ejs b/packages/cli/generators/project/templates/package.plain.json.ejs index 5aa08b3ff644..062c6af1bdb9 100644 --- a/packages/cli/generators/project/templates/package.plain.json.ejs +++ b/packages/cli/generators/project/templates/package.plain.json.ejs @@ -73,9 +73,8 @@ ], "dependencies": { "@loopback/boot": "<%= project.dependencies['@loopback/boot'] -%>", - "@loopback/context": "<%= project.dependencies['@loopback/context'] -%>", -<% if (project.projectType === 'application') { -%> "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>", +<% if (project.projectType === 'application') { -%> "@loopback/openapi-v3": "<%= project.dependencies['@loopback/openapi-v3'] -%>", "@loopback/repository": "<%= project.dependencies['@loopback/repository'] -%>", <% if (project.apiconnect) { -%> @@ -83,8 +82,6 @@ <% } -%> "@loopback/rest": "<%= project.dependencies['@loopback/rest'] -%>", "@loopback/rest-explorer": "<%= project.dependencies['@loopback/rest-explorer'] -%>", -<% } else { -%> - "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>", <% } -%> "tslib": "<%= project.dependencies['tslib'] -%>" }, diff --git a/packages/cli/snapshots/integration/generators/app.integration.snapshots.js b/packages/cli/snapshots/integration/generators/app.integration.snapshots.js index 8ac6114f8988..d166eb2920da 100644 --- a/packages/cli/snapshots/integration/generators/app.integration.snapshots.js +++ b/packages/cli/snapshots/integration/generators/app.integration.snapshots.js @@ -102,7 +102,7 @@ if (require.main === module) { exports[`app-generator specific files generates all the proper files 3`] = ` import {Request, RestBindings, get, ResponseObject} from '@loopback/rest'; -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; /** * OpenAPI response for ping() diff --git a/packages/cli/snapshots/integration/generators/controller.integration.snapshots.js b/packages/cli/snapshots/integration/generators/controller.integration.snapshots.js index 50fa55c1ffad..aff32ffcc106 100644 --- a/packages/cli/snapshots/integration/generators/controller.integration.snapshots.js +++ b/packages/cli/snapshots/integration/generators/controller.integration.snapshots.js @@ -366,7 +366,7 @@ export class ProductReviewController { exports[`lb4 controller basic controller scaffolds correct file with args 1`] = ` // Uncomment these imports to begin using these cool features! -// import {inject} from '@loopback/context'; +// import {inject} from '@loopback/core'; export class ProductReviewController { @@ -379,7 +379,7 @@ export class ProductReviewController { exports[`lb4 controller basic controller scaffolds correct file with input 1`] = ` // Uncomment these imports to begin using these cool features! -// import {inject} from '@loopback/context'; +// import {inject} from '@loopback/core'; export class ProductReviewController { diff --git a/packages/cli/snapshots/integration/generators/interceptor.integration.snapshots.js b/packages/cli/snapshots/integration/generators/interceptor.integration.snapshots.js index 634c697be479..1230df110d43 100644 --- a/packages/cli/snapshots/integration/generators/interceptor.integration.snapshots.js +++ b/packages/cli/snapshots/integration/generators/interceptor.integration.snapshots.js @@ -16,7 +16,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as an \`Interceptor\` during @@ -77,7 +77,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as an \`Interceptor\` during @@ -138,7 +138,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as an \`Interceptor\` during @@ -199,7 +199,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as an \`Interceptor\` during @@ -262,7 +262,7 @@ import { InvocationResult, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; /** * This class will be bound to the application as an \`Interceptor\` during diff --git a/packages/cli/test/integration/lib/project-generator.js b/packages/cli/test/integration/lib/project-generator.js index 00197a7e4453..0e42590bc946 100644 --- a/packages/cli/test/integration/lib/project-generator.js +++ b/packages/cli/test/integration/lib/project-generator.js @@ -277,10 +277,6 @@ module.exports = function (projGenerator, props, projectType) { 'package.json', `"@loopback/core": "${deps['@loopback/core']}"`, ); - assert.fileContent( - 'package.json', - `"@loopback/context": "${deps['@loopback/context']}"`, - ); assert.fileContent( 'package.json', `"@loopback/rest": "${deps['@loopback/rest']}"`, @@ -301,10 +297,6 @@ module.exports = function (projGenerator, props, projectType) { 'package.json', `"@loopback/core": "${deps['@loopback/core']}"`, ); - assert.fileContent( - 'package.json', - `"@loopback/context": "${deps['@loopback/context']}"`, - ); assert.noFileContent('package.json', '"@loopback/rest"'); assert.noFileContent('package.json', '"@loopback/openapi-v3"'); assert.noJsonFileContent('package.json', { @@ -340,10 +332,6 @@ module.exports = function (projGenerator, props, projectType) { 'package.json', `"@loopback/core": "${deps['@loopback/core']}"`, ); - assert.fileContent( - 'package.json', - `"@loopback/context": "${deps['@loopback/context']}"`, - ); assert.fileContent('package.json', `"rimraf": "${deps['rimraf']}"`); assert.noFileContent([ ['package.json', '@loopback/build'], diff --git a/packages/express/package.json b/packages/express/package.json index 2e8aaf9a1520..1152a93209ec 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -37,7 +37,6 @@ "!*/__tests__" ], "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/http-server": "^2.1.6", "@types/body-parser": "^1.19.0", diff --git a/packages/express/src/__tests__/acceptance/middleware-interceptor.acceptance.ts b/packages/express/src/__tests__/acceptance/middleware-interceptor.acceptance.ts index 538d3f42bb30..b6799b06824b 100644 --- a/packages/express/src/__tests__/acceptance/middleware-interceptor.acceptance.ts +++ b/packages/express/src/__tests__/acceptance/middleware-interceptor.acceptance.ts @@ -10,9 +10,9 @@ import { ContextView, createBindingFromClass, Interceptor, + InterceptorOrKey, Provider, -} from '@loopback/context'; -import {InterceptorOrKey} from '@loopback/core'; +} from '@loopback/core'; import {expect} from '@loopback/testlab'; import { createInterceptor, diff --git a/packages/express/src/__tests__/acceptance/test-helpers.ts b/packages/express/src/__tests__/acceptance/test-helpers.ts index a4d8ea666ff1..54ba1fea9e60 100644 --- a/packages/express/src/__tests__/acceptance/test-helpers.ts +++ b/packages/express/src/__tests__/acceptance/test-helpers.ts @@ -8,7 +8,7 @@ import { createProxyWithInterceptors, intercept, InterceptorOrKey, -} from '@loopback/context'; +} from '@loopback/core'; import {Client, givenHttpServerConfig, supertest} from '@loopback/testlab'; import bodyParser from 'body-parser'; import {ExpressApplication} from '../../express.application'; diff --git a/packages/express/src/keys.ts b/packages/express/src/keys.ts index 518bf9dbb317..139b94140841 100644 --- a/packages/express/src/keys.ts +++ b/packages/express/src/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; import {MiddlewareContext} from './types'; export namespace MiddlewareBindings { diff --git a/packages/express/src/middleware-registry.ts b/packages/express/src/middleware-registry.ts index 9547da0f8b11..adc521151704 100644 --- a/packages/express/src/middleware-registry.ts +++ b/packages/express/src/middleware-registry.ts @@ -20,7 +20,7 @@ import { // FIXME(rfeng): Workaround for https://github.com/microsoft/rushstack/pull/1867 /* eslint-disable @typescript-eslint/no-unused-vars */ -import * as loopbackContext from '@loopback/context'; +import * as loopbackContext from '@loopback/core'; /* eslint-enable @typescript-eslint/no-unused-vars */ /** diff --git a/packages/express/src/middleware.ts b/packages/express/src/middleware.ts index 4bad064e0f17..2865b8707e27 100644 --- a/packages/express/src/middleware.ts +++ b/packages/express/src/middleware.ts @@ -12,13 +12,14 @@ import { Constructor, Context, createBindingFromClass, + extensionFilter, + extensionFor, InvocationResult, isProviderClass, Provider, transformValueOrPromise, ValueOrPromise, -} from '@loopback/context'; -import {extensionFilter, extensionFor} from '@loopback/core'; +} from '@loopback/core'; import debugFactory from 'debug'; import {DEFAULT_MIDDLEWARE_GROUP, MIDDLEWARE_NAMESPACE} from './keys'; import { diff --git a/packages/express/src/mixins/middleware.mixin.ts b/packages/express/src/mixins/middleware.mixin.ts index 66120381f651..256461b64cfe 100644 --- a/packages/express/src/mixins/middleware.mixin.ts +++ b/packages/express/src/mixins/middleware.mixin.ts @@ -27,7 +27,7 @@ import { // FIXME(rfeng): Workaround for https://github.com/microsoft/rushstack/pull/1867 /* eslint-disable @typescript-eslint/no-unused-vars */ -import * as loopbackContext from '@loopback/context'; +import * as loopbackContext from '@loopback/core'; /* eslint-enable @typescript-eslint/no-unused-vars */ function extendsFrom( diff --git a/packages/express/tsconfig.json b/packages/express/tsconfig.json index d20b12c3793a..50d0e4a12ff6 100644 --- a/packages/express/tsconfig.json +++ b/packages/express/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" }, diff --git a/packages/repository-json-schema/package.json b/packages/repository-json-schema/package.json index 01dd2a407d44..bc355534e2be 100644 --- a/packages/repository-json-schema/package.json +++ b/packages/repository-json-schema/package.json @@ -26,8 +26,7 @@ "JSON Schema" ], "dependencies": { - "@loopback/context": "^3.8.2", - "@loopback/metadata": "^2.1.6", + "@loopback/core": "^2.7.1", "@loopback/repository": "^2.6.0", "@types/json-schema": "^7.0.4", "debug": "^4.1.1", diff --git a/packages/repository-json-schema/src/__tests__/integration/build-schema.integration.ts b/packages/repository-json-schema/src/__tests__/integration/build-schema.integration.ts index de54e31e2abe..64d6e727d78f 100644 --- a/packages/repository-json-schema/src/__tests__/integration/build-schema.integration.ts +++ b/packages/repository-json-schema/src/__tests__/integration/build-schema.integration.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {MetadataInspector} from '@loopback/context'; +import {MetadataInspector} from '@loopback/core'; import { belongsTo, Entity, diff --git a/packages/repository-json-schema/src/build-schema.ts b/packages/repository-json-schema/src/build-schema.ts index a45cd2c6a4a2..3780276315e0 100644 --- a/packages/repository-json-schema/src/build-schema.ts +++ b/packages/repository-json-schema/src/build-schema.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {MetadataInspector} from '@loopback/context'; +import {MetadataInspector} from '@loopback/core'; import { isBuiltinType, ModelDefinition, diff --git a/packages/repository-json-schema/src/keys.ts b/packages/repository-json-schema/src/keys.ts index fd33ef60bf60..5405c440d3c3 100644 --- a/packages/repository-json-schema/src/keys.ts +++ b/packages/repository-json-schema/src/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {MetadataAccessor} from '@loopback/metadata'; +import {MetadataAccessor} from '@loopback/core'; import {JsonSchema} from './index'; /** diff --git a/packages/repository-json-schema/tsconfig.json b/packages/repository-json-schema/tsconfig.json index 4dd8a495bcec..f1781a9fa1e6 100644 --- a/packages/repository-json-schema/tsconfig.json +++ b/packages/repository-json-schema/tsconfig.json @@ -11,10 +11,7 @@ ], "references": [ { - "path": "../context/tsconfig.json" - }, - { - "path": "../metadata/tsconfig.json" + "path": "../core/tsconfig.json" }, { "path": "../repository/tsconfig.json" diff --git a/packages/repository-tests/package.json b/packages/repository-tests/package.json index 3d33740f66d6..d742d22772e5 100644 --- a/packages/repository-tests/package.json +++ b/packages/repository-tests/package.json @@ -29,7 +29,7 @@ "lodash": "^4.17.15" }, "dependencies": { - "@loopback/context": "^3.8.2", + "@loopback/core": "^2.7.1", "@loopback/testlab": "^3.1.6", "@types/debug": "^4.1.5", "debug": "^4.1.1", diff --git a/packages/repository-tests/src/crud/relations/fixtures/repositories/address.repository.ts b/packages/repository-tests/src/crud/relations/fixtures/repositories/address.repository.ts index 18967dcb7fb2..c8aafad8fcb6 100644 --- a/packages/repository-tests/src/crud/relations/fixtures/repositories/address.repository.ts +++ b/packages/repository-tests/src/crud/relations/fixtures/repositories/address.repository.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import { BelongsToAccessor, juggler, diff --git a/packages/repository-tests/src/crud/relations/fixtures/repositories/customer.repository.ts b/packages/repository-tests/src/crud/relations/fixtures/repositories/customer.repository.ts index 73ae6b51ebcc..c647d52dfefc 100644 --- a/packages/repository-tests/src/crud/relations/fixtures/repositories/customer.repository.ts +++ b/packages/repository-tests/src/crud/relations/fixtures/repositories/customer.repository.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import { BelongsToAccessor, HasManyRepositoryFactory, diff --git a/packages/repository-tests/src/crud/relations/fixtures/repositories/order.repository.ts b/packages/repository-tests/src/crud/relations/fixtures/repositories/order.repository.ts index 5dbeca4e5605..e93c6f756d32 100644 --- a/packages/repository-tests/src/crud/relations/fixtures/repositories/order.repository.ts +++ b/packages/repository-tests/src/crud/relations/fixtures/repositories/order.repository.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import { BelongsToAccessor, juggler, diff --git a/packages/repository-tests/src/crud/relations/fixtures/repositories/shipment.repository.ts b/packages/repository-tests/src/crud/relations/fixtures/repositories/shipment.repository.ts index 886439c9d0ba..fce7a98c8279 100644 --- a/packages/repository-tests/src/crud/relations/fixtures/repositories/shipment.repository.ts +++ b/packages/repository-tests/src/crud/relations/fixtures/repositories/shipment.repository.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import { HasManyRepositoryFactory, juggler, diff --git a/packages/repository-tests/tsconfig.json b/packages/repository-tests/tsconfig.json index 837fe0f29315..f1781a9fa1e6 100644 --- a/packages/repository-tests/tsconfig.json +++ b/packages/repository-tests/tsconfig.json @@ -11,7 +11,7 @@ ], "references": [ { - "path": "../context/tsconfig.json" + "path": "../core/tsconfig.json" }, { "path": "../repository/tsconfig.json" diff --git a/packages/repository/examples/juggler-bridge/note-with-repo-class.ts b/packages/repository/examples/juggler-bridge/note-with-repo-class.ts index 9481830046d0..6a51056e8326 100644 --- a/packages/repository/examples/juggler-bridge/note-with-repo-class.ts +++ b/packages/repository/examples/juggler-bridge/note-with-repo-class.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; import { repository, diff --git a/packages/repository/examples/juggler-bridge/note-with-repo-instance.ts b/packages/repository/examples/juggler-bridge/note-with-repo-instance.ts index 6701909eb2bf..0144b879697a 100644 --- a/packages/repository/examples/juggler-bridge/note-with-repo-instance.ts +++ b/packages/repository/examples/juggler-bridge/note-with-repo-instance.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import { juggler, diff --git a/packages/repository/package.json b/packages/repository/package.json index 1fbf71464a71..4a5dd209116b 100644 --- a/packages/repository/package.json +++ b/packages/repository/package.json @@ -32,7 +32,6 @@ "bson": "4.0.4" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@types/debug": "^4.1.5", "debug": "^4.1.1", diff --git a/packages/repository/src/__tests__/unit/decorator/metadata.unit.ts b/packages/repository/src/__tests__/unit/decorator/metadata.unit.ts index b1d35dfae654..9db97097e667 100644 --- a/packages/repository/src/__tests__/unit/decorator/metadata.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/metadata.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {MetadataInspector} from '@loopback/context'; +import {MetadataInspector} from '@loopback/core'; import {expect} from '@loopback/testlab'; import { model, diff --git a/packages/repository/src/__tests__/unit/decorator/model-and-relation.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/model-and-relation.decorator.unit.ts index 19d3b307c97b..1cc647a59e10 100644 --- a/packages/repository/src/__tests__/unit/decorator/model-and-relation.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/model-and-relation.decorator.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {MetadataInspector} from '@loopback/context'; +import {MetadataInspector} from '@loopback/core'; import {expect} from '@loopback/testlab'; import {RelationMetadata} from '../../..'; import { diff --git a/packages/repository/src/__tests__/unit/decorator/relation.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/relation.decorator.unit.ts index b35e98a65d9c..8774c3ed0224 100644 --- a/packages/repository/src/__tests__/unit/decorator/relation.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/relation.decorator.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {MetadataInspector} from '@loopback/context'; +import {MetadataInspector} from '@loopback/core'; import {expect} from '@loopback/testlab'; import { belongsTo, diff --git a/packages/repository/src/__tests__/unit/decorator/repository-with-di.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/repository-with-di.decorator.unit.ts index 84ab8deed712..109485367895 100644 --- a/packages/repository/src/__tests__/unit/decorator/repository-with-di.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/repository-with-di.decorator.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject} from '@loopback/context'; +import {Context, inject} from '@loopback/core'; import {expect} from '@loopback/testlab'; import { DefaultCrudRepository, diff --git a/packages/repository/src/__tests__/unit/decorator/repository-with-value-provider.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/repository-with-value-provider.decorator.unit.ts index 1fcfc27fef9f..6bdf57f45e23 100644 --- a/packages/repository/src/__tests__/unit/decorator/repository-with-value-provider.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/repository-with-value-provider.decorator.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject, Provider, ValueOrPromise} from '@loopback/context'; +import {Context, inject, Provider, ValueOrPromise} from '@loopback/core'; import {expect} from '@loopback/testlab'; import { DefaultCrudRepository, diff --git a/packages/repository/src/__tests__/unit/decorator/repository.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/repository.decorator.unit.ts index 5d686772dac4..8b9d015d3214 100644 --- a/packages/repository/src/__tests__/unit/decorator/repository.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/repository.decorator.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, Getter} from '@loopback/context'; +import {Context, Getter} from '@loopback/core'; import {expect} from '@loopback/testlab'; import { DefaultCrudRepository, diff --git a/packages/repository/src/__tests__/unit/mixins/model.mixin.unit.ts b/packages/repository/src/__tests__/unit/mixins/model.mixin.unit.ts index 4b51d212b6ca..5b7bad8cbd98 100644 --- a/packages/repository/src/__tests__/unit/mixins/model.mixin.unit.ts +++ b/packages/repository/src/__tests__/unit/mixins/model.mixin.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {MetadataInspector, MetadataMap} from '@loopback/context'; +import {MetadataInspector, MetadataMap} from '@loopback/core'; import {expect} from '@loopback/testlab'; import {MODEL_PROPERTIES_KEY} from '../../../'; import {Note} from '../../fixtures/models/note.model'; diff --git a/packages/repository/src/__tests__/unit/repositories/has-many-repository-factory.unit.ts b/packages/repository/src/__tests__/unit/repositories/has-many-repository-factory.unit.ts index 7a42463b22c0..3ec5999b6c37 100644 --- a/packages/repository/src/__tests__/unit/repositories/has-many-repository-factory.unit.ts +++ b/packages/repository/src/__tests__/unit/repositories/has-many-repository-factory.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import {createStubInstance, expect} from '@loopback/testlab'; import { createHasManyRepositoryFactory, diff --git a/packages/repository/src/__tests__/unit/repositories/has-one-repository-factory.unit.ts b/packages/repository/src/__tests__/unit/repositories/has-one-repository-factory.unit.ts index fd4ec317b537..35035505ce2e 100644 --- a/packages/repository/src/__tests__/unit/repositories/has-one-repository-factory.unit.ts +++ b/packages/repository/src/__tests__/unit/repositories/has-one-repository-factory.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import {createStubInstance, expect} from '@loopback/testlab'; import { createHasOneRepositoryFactory, diff --git a/packages/repository/src/__tests__/unit/repositories/relation.repository.unit.ts b/packages/repository/src/__tests__/unit/repositories/relation.repository.unit.ts index a59d024dc615..a6a679656936 100644 --- a/packages/repository/src/__tests__/unit/repositories/relation.repository.unit.ts +++ b/packages/repository/src/__tests__/unit/repositories/relation.repository.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import { createStubInstance, expect, diff --git a/packages/repository/src/decorators/metadata.ts b/packages/repository/src/decorators/metadata.ts index c762d84e7114..c85add58a9ae 100644 --- a/packages/repository/src/decorators/metadata.ts +++ b/packages/repository/src/decorators/metadata.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {InspectionOptions, MetadataInspector} from '@loopback/context'; +import {InspectionOptions, MetadataInspector} from '@loopback/core'; import {ModelDefinition, RelationDefinitionMap} from '../model'; import {RELATIONS_KEY} from '../relations'; import { diff --git a/packages/repository/src/decorators/model.decorator.ts b/packages/repository/src/decorators/model.decorator.ts index 7261103592f8..4b78b9dae36c 100644 --- a/packages/repository/src/decorators/model.decorator.ts +++ b/packages/repository/src/decorators/model.decorator.ts @@ -9,7 +9,7 @@ import { MetadataInspector, MetadataMap, PropertyDecoratorFactory, -} from '@loopback/context'; +} from '@loopback/core'; import { ModelDefinition, ModelDefinitionSyntax, diff --git a/packages/repository/src/decorators/repository.decorator.ts b/packages/repository/src/decorators/repository.decorator.ts index 406a86b6120e..f06a542caff1 100644 --- a/packages/repository/src/decorators/repository.decorator.ts +++ b/packages/repository/src/decorators/repository.decorator.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject, Injection} from '@loopback/context'; +import {Context, inject, Injection} from '@loopback/core'; import assert from 'assert'; import {Class} from '../common-types'; import {DataSource} from '../datasource'; diff --git a/packages/repository/src/mixins/repository.mixin.ts b/packages/repository/src/mixins/repository.mixin.ts index 0472bc79d9c0..302e344bb53c 100644 --- a/packages/repository/src/mixins/repository.mixin.ts +++ b/packages/repository/src/mixins/repository.mixin.ts @@ -8,7 +8,7 @@ import { BindingFromClassOptions, BindingScope, createBindingFromClass, -} from '@loopback/context'; +} from '@loopback/core'; import { Application, Component, @@ -27,7 +27,7 @@ const debug = debugFactory('loopback:repository:mixin'); // FIXME(rfeng): Workaround for https://github.com/microsoft/rushstack/pull/1867 /* eslint-disable @typescript-eslint/no-unused-vars */ -import * as loopbackContext from '@loopback/context'; +import * as loopbackContext from '@loopback/core'; import * as loopbackCore from '@loopback/core'; /* eslint-enable @typescript-eslint/no-unused-vars */ diff --git a/packages/repository/src/relations/belongs-to/belongs-to.decorator.ts b/packages/repository/src/relations/belongs-to/belongs-to.decorator.ts index 9dcace9e17d1..8594a63cb98c 100644 --- a/packages/repository/src/relations/belongs-to/belongs-to.decorator.ts +++ b/packages/repository/src/relations/belongs-to/belongs-to.decorator.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {MetadataInspector} from '@loopback/context'; +import {MetadataInspector} from '@loopback/core'; import {property} from '../../decorators/model.decorator'; import {Entity, EntityResolver, PropertyDefinition} from '../../model'; import {relation} from '../relation.decorator'; diff --git a/packages/repository/src/relations/belongs-to/belongs-to.repository.ts b/packages/repository/src/relations/belongs-to/belongs-to.repository.ts index 29b934f9fe7b..3ac621b6a998 100644 --- a/packages/repository/src/relations/belongs-to/belongs-to.repository.ts +++ b/packages/repository/src/relations/belongs-to/belongs-to.repository.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import {DataObject, Options} from '../../common-types'; import {EntityNotFoundError} from '../../errors'; import {Entity} from '../../model'; diff --git a/packages/repository/src/relations/has-many/has-many.repository.ts b/packages/repository/src/relations/has-many/has-many.repository.ts index 8d1609a4f51e..a36e4e110217 100644 --- a/packages/repository/src/relations/has-many/has-many.repository.ts +++ b/packages/repository/src/relations/has-many/has-many.repository.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import {Count, DataObject, Options} from '../../common-types'; import {Entity} from '../../model'; import {Filter, Where} from '../../query'; diff --git a/packages/repository/src/relations/has-one/has-one.repository.ts b/packages/repository/src/relations/has-one/has-one.repository.ts index 7589cda4df53..1d05f95f5b53 100644 --- a/packages/repository/src/relations/has-one/has-one.repository.ts +++ b/packages/repository/src/relations/has-one/has-one.repository.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import {Count, DataObject, Options} from '../../common-types'; import {EntityNotFoundError} from '../../errors'; import {Entity} from '../../model'; diff --git a/packages/repository/src/relations/relation.decorator.ts b/packages/repository/src/relations/relation.decorator.ts index 6efc114cb485..43229b9f207c 100644 --- a/packages/repository/src/relations/relation.decorator.ts +++ b/packages/repository/src/relations/relation.decorator.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {PropertyDecoratorFactory} from '@loopback/context'; +import {PropertyDecoratorFactory} from '@loopback/core'; import {buildModelDefinition} from '../decorators'; import {Model, RelationDefinitionMap} from '../model'; import {RelationType} from './relation.types'; diff --git a/packages/repository/src/relations/relation.types.ts b/packages/repository/src/relations/relation.types.ts index a1ec4232911b..00658b609e28 100644 --- a/packages/repository/src/relations/relation.types.ts +++ b/packages/repository/src/relations/relation.types.ts @@ -155,7 +155,7 @@ export type RelationMetadata = | RelationDefinitionBase; // Re-export Getter so that users don't have to import from @loopback/context -export {Getter} from '@loopback/context'; +export {Getter} from '@loopback/core'; /** * @returns An array of resolved values, the items must be ordered in the same diff --git a/packages/repository/src/repositories/legacy-juggler-bridge.ts b/packages/repository/src/repositories/legacy-juggler-bridge.ts index dec68f72d511..1daa56b6910f 100644 --- a/packages/repository/src/repositories/legacy-juggler-bridge.ts +++ b/packages/repository/src/repositories/legacy-juggler-bridge.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Getter} from '@loopback/context'; +import {Getter} from '@loopback/core'; import assert from 'assert'; import legacy from 'loopback-datasource-juggler'; import { diff --git a/packages/repository/tsconfig.json b/packages/repository/tsconfig.json index f22cfe9f58d2..134a68e33164 100644 --- a/packages/repository/tsconfig.json +++ b/packages/repository/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" }, diff --git a/packages/rest-explorer/package.json b/packages/rest-explorer/package.json index a4f55c0bd674..281fb4a16c07 100644 --- a/packages/rest-explorer/package.json +++ b/packages/rest-explorer/package.json @@ -21,7 +21,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/rest": "^5.1.0", "ejs": "^3.1.3", diff --git a/packages/rest-explorer/src/rest-explorer.component.ts b/packages/rest-explorer/src/rest-explorer.component.ts index 422c0043b837..94e06eb63a5c 100644 --- a/packages/rest-explorer/src/rest-explorer.component.ts +++ b/packages/rest-explorer/src/rest-explorer.component.ts @@ -3,9 +3,15 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import {bind, config, ContextTags, inject} from '@loopback/context'; -import {Component, CoreBindings} from '@loopback/core'; +import { + bind, + Component, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + config, + ContextTags, + CoreBindings, + inject, +} from '@loopback/core'; import {createControllerFactoryForClass, RestApplication} from '@loopback/rest'; import {ExplorerController} from './rest-explorer.controller'; import {RestExplorerBindings} from './rest-explorer.keys'; diff --git a/packages/rest-explorer/src/rest-explorer.controller.ts b/packages/rest-explorer/src/rest-explorer.controller.ts index c005b8ebd3fd..546395d89ed9 100644 --- a/packages/rest-explorer/src/rest-explorer.controller.ts +++ b/packages/rest-explorer/src/rest-explorer.controller.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT // eslint-disable-next-line @typescript-eslint/no-unused-vars -import {config, inject} from '@loopback/context'; +import {config, inject} from '@loopback/core'; import { OpenApiSpecForm, RequestContext, diff --git a/packages/rest-explorer/src/rest-explorer.keys.ts b/packages/rest-explorer/src/rest-explorer.keys.ts index c41306a9183f..f05d7662f0c8 100644 --- a/packages/rest-explorer/src/rest-explorer.keys.ts +++ b/packages/rest-explorer/src/rest-explorer.keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingAddress, BindingKey} from '@loopback/context'; +import {BindingAddress, BindingKey} from '@loopback/core'; import {RestExplorerComponent} from './rest-explorer.component'; import {RestExplorerConfig} from './rest-explorer.types'; diff --git a/packages/rest-explorer/tsconfig.json b/packages/rest-explorer/tsconfig.json index d4095d8c61d4..44a90721d916 100644 --- a/packages/rest-explorer/tsconfig.json +++ b/packages/rest-explorer/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" }, diff --git a/packages/rest/package.json b/packages/rest/package.json index 7421a433b74f..062f04c5201a 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -24,7 +24,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "@loopback/express": "^1.2.2", "@loopback/http-server": "^2.1.6", diff --git a/packages/rest/src/__tests__/acceptance/caching-interceptor/caching-interceptor.acceptance.ts b/packages/rest/src/__tests__/acceptance/caching-interceptor/caching-interceptor.acceptance.ts index 9477ed0755aa..3f0d78717821 100644 --- a/packages/rest/src/__tests__/acceptance/caching-interceptor/caching-interceptor.acceptance.ts +++ b/packages/rest/src/__tests__/acceptance/caching-interceptor/caching-interceptor.acceptance.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {intercept} from '@loopback/context'; +import {intercept} from '@loopback/core'; import {get, param} from '@loopback/openapi-v3'; import { Client, diff --git a/packages/rest/src/__tests__/acceptance/caching-interceptor/caching-interceptor.ts b/packages/rest/src/__tests__/acceptance/caching-interceptor/caching-interceptor.ts index c9fdcc715c88..1429b0d8b4dd 100644 --- a/packages/rest/src/__tests__/acceptance/caching-interceptor/caching-interceptor.ts +++ b/packages/rest/src/__tests__/acceptance/caching-interceptor/caching-interceptor.ts @@ -9,7 +9,7 @@ import { InvocationContext, Provider, ValueOrPromise, -} from '@loopback/context'; +} from '@loopback/core'; import {Request, RestBindings, RouteSource} from '../../..'; /** diff --git a/packages/rest/src/__tests__/acceptance/caching-interceptor/global-caching-interceptor.acceptance.ts b/packages/rest/src/__tests__/acceptance/caching-interceptor/global-caching-interceptor.acceptance.ts index 9d45886fcc4d..5e7012cd033e 100644 --- a/packages/rest/src/__tests__/acceptance/caching-interceptor/global-caching-interceptor.acceptance.ts +++ b/packages/rest/src/__tests__/acceptance/caching-interceptor/global-caching-interceptor.acceptance.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {asGlobalInterceptor} from '@loopback/context'; +import {asGlobalInterceptor} from '@loopback/core'; import {anOperationSpec} from '@loopback/openapi-spec-builder'; import {get, param} from '@loopback/openapi-v3'; import { diff --git a/packages/rest/src/__tests__/acceptance/file-upload/file-upload.acceptance.ts b/packages/rest/src/__tests__/acceptance/file-upload/file-upload.acceptance.ts index fbee0e611657..3914f709d58a 100644 --- a/packages/rest/src/__tests__/acceptance/file-upload/file-upload.acceptance.ts +++ b/packages/rest/src/__tests__/acceptance/file-upload/file-upload.acceptance.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import { Client, createRestAppClient, diff --git a/packages/rest/src/__tests__/acceptance/middleware/test-helpers.ts b/packages/rest/src/__tests__/acceptance/middleware/test-helpers.ts index 7e505ad73386..45cd8a644b6c 100644 --- a/packages/rest/src/__tests__/acceptance/middleware/test-helpers.ts +++ b/packages/rest/src/__tests__/acceptance/middleware/test-helpers.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Binding, intercept, InterceptorOrKey} from '@loopback/context'; +import {Binding, intercept, InterceptorOrKey} from '@loopback/core'; import {post, requestBody} from '@loopback/openapi-v3'; import { Client, diff --git a/packages/rest/src/__tests__/acceptance/routing/routing.acceptance.ts b/packages/rest/src/__tests__/acceptance/routing/routing.acceptance.ts index 02a1c90406be..5f93d3bb146b 100644 --- a/packages/rest/src/__tests__/acceptance/routing/routing.acceptance.ts +++ b/packages/rest/src/__tests__/acceptance/routing/routing.acceptance.ts @@ -3,8 +3,14 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingScope, Constructor, Context, inject} from '@loopback/context'; -import {Application, CoreBindings} from '@loopback/core'; +import { + BindingScope, + Constructor, + Context, + inject, + Application, + CoreBindings, +} from '@loopback/core'; import {anOpenApiSpec, anOperationSpec} from '@loopback/openapi-spec-builder'; import { api, diff --git a/packages/rest/src/__tests__/acceptance/sequence/sequence.acceptance.ts b/packages/rest/src/__tests__/acceptance/sequence/sequence.acceptance.ts index f9546d529488..b4fd71f577b8 100644 --- a/packages/rest/src/__tests__/acceptance/sequence/sequence.acceptance.ts +++ b/packages/rest/src/__tests__/acceptance/sequence/sequence.acceptance.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; -import {Application} from '@loopback/core'; +import {inject, Application} from '@loopback/core'; import {anOpenApiSpec} from '@loopback/openapi-spec-builder'; import {api} from '@loopback/openapi-v3'; import {Client, createClientForHandler} from '@loopback/testlab'; diff --git a/packages/rest/src/__tests__/integration/http-handler.integration.ts b/packages/rest/src/__tests__/integration/http-handler.integration.ts index fec3636d1406..644672a26539 100644 --- a/packages/rest/src/__tests__/integration/http-handler.integration.ts +++ b/packages/rest/src/__tests__/integration/http-handler.integration.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import {anOpenApiSpec, anOperationSpec} from '@loopback/openapi-spec-builder'; import { ControllerSpec, diff --git a/packages/rest/src/__tests__/unit/rest.component.unit.ts b/packages/rest/src/__tests__/unit/rest.component.unit.ts index 3f2fd4c5f424..8cf279e2944f 100644 --- a/packages/rest/src/__tests__/unit/rest.component.unit.ts +++ b/packages/rest/src/__tests__/unit/rest.component.unit.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BoundValue, Context, inject, Provider} from '@loopback/context'; +import {BoundValue, Context, inject, Provider} from '@loopback/core'; import { Application, Component, diff --git a/packages/rest/src/__tests__/unit/rest.server/rest.server.unit.ts b/packages/rest/src/__tests__/unit/rest.server/rest.server.unit.ts index bde5f3e3691e..9538d279f76f 100644 --- a/packages/rest/src/__tests__/unit/rest.server/rest.server.unit.ts +++ b/packages/rest/src/__tests__/unit/rest.server/rest.server.unit.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; -import {Application} from '@loopback/core'; +import {Context, Application} from '@loopback/core'; import {anOperationSpec} from '@loopback/openapi-spec-builder'; import {expect} from '@loopback/testlab'; import { diff --git a/packages/rest/src/body-parsers/body-parser.json.ts b/packages/rest/src/body-parsers/body-parser.json.ts index e6ec497aaf83..0b81860c3c3d 100644 --- a/packages/rest/src/body-parsers/body-parser.json.ts +++ b/packages/rest/src/body-parsers/body-parser.json.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {json} from 'body-parser'; import {is} from 'type-is'; import {RestBindings} from '../keys'; diff --git a/packages/rest/src/body-parsers/body-parser.raw.ts b/packages/rest/src/body-parsers/body-parser.raw.ts index 94a64fbd4ba5..8cd353062cc9 100644 --- a/packages/rest/src/body-parsers/body-parser.raw.ts +++ b/packages/rest/src/body-parsers/body-parser.raw.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {raw} from 'body-parser'; import {is} from 'type-is'; import {RestBindings} from '../keys'; diff --git a/packages/rest/src/body-parsers/body-parser.text.ts b/packages/rest/src/body-parsers/body-parser.text.ts index ed540e8bd839..6c296f25c4dc 100644 --- a/packages/rest/src/body-parsers/body-parser.text.ts +++ b/packages/rest/src/body-parsers/body-parser.text.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {text} from 'body-parser'; import {is} from 'type-is'; import {RestBindings} from '../keys'; diff --git a/packages/rest/src/body-parsers/body-parser.ts b/packages/rest/src/body-parsers/body-parser.ts index 72b6c9d33836..cbb7b76f3fb1 100644 --- a/packages/rest/src/body-parsers/body-parser.ts +++ b/packages/rest/src/body-parsers/body-parser.ts @@ -10,7 +10,7 @@ import { filterByTag, inject, instantiateClass, -} from '@loopback/context'; +} from '@loopback/core'; import {isReferenceObject, OperationObject} from '@loopback/openapi-v3'; import debugModule from 'debug'; import {is} from 'type-is'; diff --git a/packages/rest/src/body-parsers/body-parser.urlencoded.ts b/packages/rest/src/body-parsers/body-parser.urlencoded.ts index c264e4ba5bd0..a910a5998d62 100644 --- a/packages/rest/src/body-parsers/body-parser.urlencoded.ts +++ b/packages/rest/src/body-parsers/body-parser.urlencoded.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {urlencoded} from 'body-parser'; import {is} from 'type-is'; import {RestBindings} from '../keys'; diff --git a/packages/rest/src/http-handler.ts b/packages/rest/src/http-handler.ts index 239657ced583..03e3be4ba1e7 100644 --- a/packages/rest/src/http-handler.ts +++ b/packages/rest/src/http-handler.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import { ComponentsObject, ControllerSpec, diff --git a/packages/rest/src/keys.ts b/packages/rest/src/keys.ts index dbd885c8f0a5..a1fdc8755342 100644 --- a/packages/rest/src/keys.ts +++ b/packages/rest/src/keys.ts @@ -3,8 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey, Context} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +import {BindingKey, Context, CoreBindings} from '@loopback/core'; import {InvokeMiddleware} from '@loopback/express'; import {HttpProtocol} from '@loopback/http-server'; import {OpenApiSpec, OperationObject} from '@loopback/openapi-v3'; diff --git a/packages/rest/src/providers/find-route.provider.ts b/packages/rest/src/providers/find-route.provider.ts index 4c599a80b6ab..bc02702db279 100644 --- a/packages/rest/src/providers/find-route.provider.ts +++ b/packages/rest/src/providers/find-route.provider.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject, Provider} from '@loopback/context'; +import {Context, inject, Provider} from '@loopback/core'; import {FindRoute, Request} from '../types'; import {HttpHandler} from '../http-handler'; import {RestBindings} from '../keys'; diff --git a/packages/rest/src/providers/invoke-method.provider.ts b/packages/rest/src/providers/invoke-method.provider.ts index fa085af12465..3bf4a1b74865 100644 --- a/packages/rest/src/providers/invoke-method.provider.ts +++ b/packages/rest/src/providers/invoke-method.provider.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, inject, Provider} from '@loopback/context'; +import {Context, inject, Provider} from '@loopback/core'; import {InvokeMethod, OperationArgs, OperationRetval} from '../types'; import {RestBindings} from '../keys'; import {RouteEntry} from '../router'; diff --git a/packages/rest/src/providers/log-error.provider.ts b/packages/rest/src/providers/log-error.provider.ts index 890a29cbfbb0..53da86848d79 100644 --- a/packages/rest/src/providers/log-error.provider.ts +++ b/packages/rest/src/providers/log-error.provider.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Provider} from '@loopback/context'; +import {Provider} from '@loopback/core'; import {LogError, Request} from '../types'; export class LogErrorProvider implements Provider { diff --git a/packages/rest/src/providers/parse-params.provider.ts b/packages/rest/src/providers/parse-params.provider.ts index c2711398a546..724da615a800 100644 --- a/packages/rest/src/providers/parse-params.provider.ts +++ b/packages/rest/src/providers/parse-params.provider.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject, Provider} from '@loopback/context'; +import {inject, Provider} from '@loopback/core'; import {RequestBodyParser} from '../body-parsers'; import {RestBindings} from '../keys'; import {parseOperationArgs} from '../parser'; diff --git a/packages/rest/src/providers/reject.provider.ts b/packages/rest/src/providers/reject.provider.ts index bcc4ebc695f4..e2bb5adb08e1 100644 --- a/packages/rest/src/providers/reject.provider.ts +++ b/packages/rest/src/providers/reject.provider.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT import {LogError, Reject, HandlerContext} from '../types'; -import {inject, Provider} from '@loopback/context'; +import {inject, Provider} from '@loopback/core'; import {HttpError} from 'http-errors'; import {RestBindings} from '../keys'; import {writeErrorToResponse, ErrorWriterOptions} from 'strong-error-handler'; diff --git a/packages/rest/src/providers/send.provider.ts b/packages/rest/src/providers/send.provider.ts index 3f80f421d96a..2d3f549b7dce 100644 --- a/packages/rest/src/providers/send.provider.ts +++ b/packages/rest/src/providers/send.provider.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Provider, BoundValue} from '@loopback/context'; +import {Provider, BoundValue} from '@loopback/core'; import {writeResultToResponse} from '../writer'; /** * Provides the function that populates the response object with diff --git a/packages/rest/src/request-context.ts b/packages/rest/src/request-context.ts index 8a04b275b6be..8a1795bd9214 100644 --- a/packages/rest/src/request-context.ts +++ b/packages/rest/src/request-context.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import { HandlerContext, MiddlewareContext, diff --git a/packages/rest/src/rest.application.ts b/packages/rest/src/rest.application.ts index 8618d0baa1c5..763d7473a00c 100644 --- a/packages/rest/src/rest.application.ts +++ b/packages/rest/src/rest.application.ts @@ -4,13 +4,15 @@ // License text available at https://opensource.org/licenses/MIT import { + Application, + ApplicationConfig, Binding, BindingAddress, Constructor, Context, Provider, -} from '@loopback/context'; -import {Application, ApplicationConfig, Server} from '@loopback/core'; + Server, +} from '@loopback/core'; import { ExpressMiddlewareFactory, ExpressRequestHandler, diff --git a/packages/rest/src/rest.component.ts b/packages/rest/src/rest.component.ts index 543f6c462db8..91f3806ae029 100644 --- a/packages/rest/src/rest.component.ts +++ b/packages/rest/src/rest.component.ts @@ -8,7 +8,7 @@ import { Constructor, createBindingFromClass, inject, -} from '@loopback/context'; +} from '@loopback/core'; import { Application, Component, diff --git a/packages/rest/src/rest.server.ts b/packages/rest/src/rest.server.ts index 54d867c28243..c5c5c91c87d1 100644 --- a/packages/rest/src/rest.server.ts +++ b/packages/rest/src/rest.server.ts @@ -4,18 +4,20 @@ // License text available at https://opensource.org/licenses/MIT import { + Application, Binding, BindingAddress, BindingScope, Constructor, ContextObserver, + CoreBindings, createBindingFromClass, filterByKey, filterByTag, inject, + Server, Subscription, -} from '@loopback/context'; -import {Application, CoreBindings, Server} from '@loopback/core'; +} from '@loopback/core'; import {BaseMiddlewareRegistry, ExpressRequestHandler} from '@loopback/express'; import {HttpServer, HttpServerOptions} from '@loopback/http-server'; import { diff --git a/packages/rest/src/router/base-route.ts b/packages/rest/src/router/base-route.ts index b74c18fe0162..5b214bffd700 100644 --- a/packages/rest/src/router/base-route.ts +++ b/packages/rest/src/router/base-route.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, InvocationSource} from '@loopback/context'; +import {Context, InvocationSource} from '@loopback/core'; import {OperationObject} from '@loopback/openapi-v3'; import {OperationArgs, OperationRetval} from '../types'; import {RouteEntry} from './route-entry'; diff --git a/packages/rest/src/router/controller-route.ts b/packages/rest/src/router/controller-route.ts index cf2d1d83db2d..05d5aaeafdfa 100644 --- a/packages/rest/src/router/controller-route.ts +++ b/packages/rest/src/router/controller-route.ts @@ -7,11 +7,11 @@ import { BindingScope, Constructor, Context, + CoreBindings, instantiateClass, invokeMethod, ValueOrPromise, -} from '@loopback/context'; -import {CoreBindings} from '@loopback/core'; +} from '@loopback/core'; import {ControllerSpec, OperationObject} from '@loopback/openapi-v3'; import assert from 'assert'; import debugFactory from 'debug'; diff --git a/packages/rest/src/router/external-express-routes.ts b/packages/rest/src/router/external-express-routes.ts index c9a324484422..60e271cceba4 100644 --- a/packages/rest/src/router/external-express-routes.ts +++ b/packages/rest/src/router/external-express-routes.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import { executeExpressRequestHandler, ExpressRequestHandler, diff --git a/packages/rest/src/router/handler-route.ts b/packages/rest/src/router/handler-route.ts index fa0fa61f059c..b26184de9ad8 100644 --- a/packages/rest/src/router/handler-route.ts +++ b/packages/rest/src/router/handler-route.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context, invokeMethodWithInterceptors} from '@loopback/context'; +import {Context, invokeMethodWithInterceptors} from '@loopback/core'; import {OperationObject} from '@loopback/openapi-v3'; import {RestBindings} from '../keys'; import {OperationArgs, OperationRetval} from '../types'; diff --git a/packages/rest/src/router/regexp-router.ts b/packages/rest/src/router/regexp-router.ts index 7760c815ee8e..069ebe0170ca 100644 --- a/packages/rest/src/router/regexp-router.ts +++ b/packages/rest/src/router/regexp-router.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {inspect} from 'util'; import {RestBindings} from '../keys'; import {PathParameterValues} from '../types'; diff --git a/packages/rest/src/router/route-entry.ts b/packages/rest/src/router/route-entry.ts index 161e19b9e06d..bd250d83a958 100644 --- a/packages/rest/src/router/route-entry.ts +++ b/packages/rest/src/router/route-entry.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import {OperationObject, SchemasObject} from '@loopback/openapi-v3'; import {OperationArgs, OperationRetval, PathParameterValues} from '../types'; diff --git a/packages/rest/src/router/trie-router.ts b/packages/rest/src/router/trie-router.ts index d7560b44e853..dbdd1ccc9dfa 100644 --- a/packages/rest/src/router/trie-router.ts +++ b/packages/rest/src/router/trie-router.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {inject} from '@loopback/context'; +import {inject} from '@loopback/core'; import {inspect} from 'util'; import {RestBindings} from '../keys'; import {RestRouterOptions} from './rest-router'; diff --git a/packages/rest/src/sequence.ts b/packages/rest/src/sequence.ts index 25e3f1422cae..abaef7ffe673 100644 --- a/packages/rest/src/sequence.ts +++ b/packages/rest/src/sequence.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT const debug = require('debug')('loopback:rest:sequence'); -import {inject, ValueOrPromise} from '@loopback/context'; +import {inject, ValueOrPromise} from '@loopback/core'; import {InvokeMiddleware} from '@loopback/express'; import {RestBindings} from './keys'; import {RequestContext} from './request-context'; diff --git a/packages/rest/src/spec-enhancers/info.spec-enhancer.ts b/packages/rest/src/spec-enhancers/info.spec-enhancer.ts index 7b9f25aa9750..a2e69db776ea 100644 --- a/packages/rest/src/spec-enhancers/info.spec-enhancer.ts +++ b/packages/rest/src/spec-enhancers/info.spec-enhancer.ts @@ -4,13 +4,14 @@ // License text available at https://opensource.org/licenses/MIT import { + ApplicationMetadata, bind, BindingScope, + CoreBindings, inject, JSONObject, JSONValue, -} from '@loopback/context'; -import {ApplicationMetadata, CoreBindings} from '@loopback/core'; +} from '@loopback/core'; import { asSpecEnhancer, ContactObject, diff --git a/packages/rest/tsconfig.json b/packages/rest/tsconfig.json index 694c3b0400c4..66a2e7b92e00 100644 --- a/packages/rest/tsconfig.json +++ b/packages/rest/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" }, diff --git a/packages/security/package.json b/packages/security/package.json index dcd68cb10b48..27279d782c6a 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -24,7 +24,6 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "debug": "^4.1.1", "tslib": "^2.0.0" diff --git a/packages/security/src/keys.ts b/packages/security/src/keys.ts index b135dafc85a2..4093e94b60d8 100644 --- a/packages/security/src/keys.ts +++ b/packages/security/src/keys.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {BindingKey} from '@loopback/context'; +import {BindingKey} from '@loopback/core'; import {Subject, UserProfile} from './types'; /** diff --git a/packages/security/tsconfig.json b/packages/security/tsconfig.json index f22cfe9f58d2..134a68e33164 100644 --- a/packages/security/tsconfig.json +++ b/packages/security/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" }, diff --git a/packages/service-proxy/package.json b/packages/service-proxy/package.json index 93adba485d9e..d6be241a04a5 100644 --- a/packages/service-proxy/package.json +++ b/packages/service-proxy/package.json @@ -30,7 +30,6 @@ "@types/node": "^10.17.24" }, "dependencies": { - "@loopback/context": "^3.8.2", "@loopback/core": "^2.7.1", "loopback-datasource-juggler": "^4.21.2", "tslib": "^2.0.0" diff --git a/packages/service-proxy/src/__tests__/unit/decorators/service-proxy.decorator.unit.ts b/packages/service-proxy/src/__tests__/unit/decorators/service-proxy.decorator.unit.ts index 3f7ca3d335e0..f3e99a99a2a8 100644 --- a/packages/service-proxy/src/__tests__/unit/decorators/service-proxy.decorator.unit.ts +++ b/packages/service-proxy/src/__tests__/unit/decorators/service-proxy.decorator.unit.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT import {expect} from '@loopback/testlab'; -import {Context} from '@loopback/context'; +import {Context} from '@loopback/core'; import {serviceProxy} from '../../../'; import {juggler} from '../../../'; diff --git a/packages/service-proxy/src/decorators/service.decorator.ts b/packages/service-proxy/src/decorators/service.decorator.ts index 5267514facd2..11de70d8651d 100644 --- a/packages/service-proxy/src/decorators/service.decorator.ts +++ b/packages/service-proxy/src/decorators/service.decorator.ts @@ -9,7 +9,7 @@ import { Context, Injection, InjectionMetadata, -} from '@loopback/context'; +} from '@loopback/core'; import {getService, juggler} from '..'; /** diff --git a/packages/service-proxy/src/mixins/service.mixin.ts b/packages/service-proxy/src/mixins/service.mixin.ts index faeedc252a04..e113b92eac2e 100644 --- a/packages/service-proxy/src/mixins/service.mixin.ts +++ b/packages/service-proxy/src/mixins/service.mixin.ts @@ -9,7 +9,7 @@ import { BindingFromClassOptions, Provider, Constructor, -} from '@loopback/context'; +} from '@loopback/core'; import { Application, MixinTarget, @@ -19,7 +19,7 @@ import { // FIXME(rfeng): Workaround for https://github.com/microsoft/rushstack/pull/1867 /* eslint-disable @typescript-eslint/no-unused-vars */ -import * as loopbackContext from '@loopback/context'; +import * as loopbackContext from '@loopback/core'; import * as loopbackCore from '@loopback/core'; /* eslint-enable @typescript-eslint/no-unused-vars */ diff --git a/packages/service-proxy/tsconfig.json b/packages/service-proxy/tsconfig.json index f22cfe9f58d2..134a68e33164 100644 --- a/packages/service-proxy/tsconfig.json +++ b/packages/service-proxy/tsconfig.json @@ -10,9 +10,6 @@ "src" ], "references": [ - { - "path": "../context/tsconfig.json" - }, { "path": "../core/tsconfig.json" },