From c0130a60db7002944c4c93a6e0a6fda5e0fc71a7 Mon Sep 17 00:00:00 2001 From: biniam Date: Sun, 15 Apr 2018 17:34:22 -0400 Subject: [PATCH 01/14] chore: add yeoman-environment dep --- packages/cli/package.json | 1 + packages/cli/test/test-utils.js | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index b9e2324e1696..8a55a4f885af 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -35,6 +35,7 @@ "rimraf": "^2.6.2", "sinon": "^4.5.0", "yeoman-assert": "^3.1.1", + "yeoman-environment": "^2.0.6", "yeoman-test": "^1.7.0" }, "dependencies": { diff --git a/packages/cli/test/test-utils.js b/packages/cli/test/test-utils.js index 13cf97d939b3..7ef94c080b6b 100644 --- a/packages/cli/test/test-utils.js +++ b/packages/cli/test/test-utils.js @@ -5,13 +5,10 @@ 'use strict'; -const _ = require('lodash'); const yeoman = require('yeoman-environment'); const path = require('path'); const helpers = require('yeoman-test'); const fs = require('fs'); -const util = require('util'); -const RunContext = require('yeoman-test/lib/run-context'); exports.testSetUpGen = function(genName, arg) { arg = arg || {}; From b0ae476a38b9183a2276f7328cc07b92f97141de Mon Sep 17 00:00:00 2001 From: "Paul \"Joey\" Clark" Date: Mon, 16 Apr 2018 16:59:07 +0800 Subject: [PATCH 02/14] refactor: use throw instead of Promise.reject where possible I recommend `throw` over `return Promise.reject()` because: 1. It is shorter, which makes it easier to read. 2. It retains some parity between synchronous and asynchronous code. (It will continue to work as expected if those lines were extracted into a synchronous function.) There are [some occasions](https://gist.github.com/joeytwiddle/21331531f50885345e063d59ec7f11f2) when you cannot use `throw` in place of returning a rejection, but if you are in the body of an async function then it is always safe. --- docs/site/todo-tutorial-controller.md | 4 ++-- examples/todo/src/controllers/todo.controller.ts | 2 +- .../src/providers/authentication.provider.ts | 2 +- packages/cli/generators/controller/index.js | 10 ++-------- .../src/repositories/legacy-juggler-bridge.ts | 4 +--- packages/rest/src/parser.ts | 9 ++++----- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/docs/site/todo-tutorial-controller.md b/docs/site/todo-tutorial-controller.md index 2c3a4d729110..d12b58a481d9 100644 --- a/docs/site/todo-tutorial-controller.md +++ b/docs/site/todo-tutorial-controller.md @@ -77,7 +77,7 @@ export class TodoController { @post('/todo') async createTodo(@requestBody() todo: Todo) { if (!todo.title) { - return Promise.reject(new HttpErrors.BadRequest('title is required')); + throw new HttpErrors.BadRequest('title is required'); } return await this.todoRepo.create(todo); } @@ -127,7 +127,7 @@ export class TodoController { @post('/todo') async createTodo(@requestBody() todo: Todo) { if (!todo.title) { - return Promise.reject(new HttpErrors.BadRequest('title is required')); + throw new HttpErrors.BadRequest('title is required'); } return await this.todoRepo.create(todo); } diff --git a/examples/todo/src/controllers/todo.controller.ts b/examples/todo/src/controllers/todo.controller.ts index 568edb3919b2..06f4b8496a5e 100644 --- a/examples/todo/src/controllers/todo.controller.ts +++ b/examples/todo/src/controllers/todo.controller.ts @@ -25,7 +25,7 @@ export class TodoController { // TODO(bajtos) This should be handled by the framework // See https://github.com/strongloop/loopback-next/issues/118 if (!todo.title) { - return Promise.reject(new HttpErrors.BadRequest('title is required')); + throw new HttpErrors.BadRequest('title is required'); } return await this.todoRepo.create(todo); } diff --git a/packages/authentication/src/providers/authentication.provider.ts b/packages/authentication/src/providers/authentication.provider.ts index bc671b5baecd..90e45530a476 100644 --- a/packages/authentication/src/providers/authentication.provider.ts +++ b/packages/authentication/src/providers/authentication.provider.ts @@ -72,7 +72,7 @@ export class AuthenticateActionProvider implements Provider { return undefined; } if (!strategy.authenticate) { - return Promise.reject(new Error('invalid strategy parameter')); + throw new Error('invalid strategy parameter'); } const strategyAdapter = new StrategyAdapter(strategy); const user = await strategyAdapter.authenticate(request); diff --git a/packages/cli/generators/controller/index.js b/packages/cli/generators/controller/index.js index c701f4f6fb46..bacc190df8b9 100644 --- a/packages/cli/generators/controller/index.js +++ b/packages/cli/generators/controller/index.js @@ -100,9 +100,7 @@ module.exports = class ControllerGenerator extends ArtifactGenerator { .getArtifactList(this.artifactInfo.modelDir, 'model') .then(list => { if (_.isEmpty(list)) { - return Promise.reject( - new Error(`No models found in ${this.artifactInfo.modelDir}`) - ); + throw new Error(`No models found in ${this.artifactInfo.modelDir}`); } modelList = list; return utils.getArtifactList( @@ -113,11 +111,7 @@ module.exports = class ControllerGenerator extends ArtifactGenerator { }) .then(list => { if (_.isEmpty(list)) { - return Promise.reject( - new Error( - `No repositories found in ${this.artifactInfo.repositoryDir}` - ) - ); + throw new Error(`No repositories found in ${this.artifactInfo.repositoryDir}`); } repositoryList = list; return this.prompt([ diff --git a/packages/repository/src/repositories/legacy-juggler-bridge.ts b/packages/repository/src/repositories/legacy-juggler-bridge.ts index 348c13f554dd..986d4ccb8902 100644 --- a/packages/repository/src/repositories/legacy-juggler-bridge.ts +++ b/packages/repository/src/repositories/legacy-juggler-bridge.ts @@ -152,9 +152,7 @@ export class DefaultCrudRepository this.modelClass.findById(id, filter, options), ); if (!model) { - return Promise.reject( - new Error(`no ${this.modelClass.name} found with id "${id}"`), - ); + throw new Error(`no ${this.modelClass.name} found with id "${id}"`); } return this.toEntity(model); } diff --git a/packages/rest/src/parser.ts b/packages/rest/src/parser.ts index 95d5e0b8f21f..210c361ed2fc 100644 --- a/packages/rest/src/parser.ts +++ b/packages/rest/src/parser.ts @@ -60,7 +60,7 @@ export async function parseOperationArgs( return buildOperationArguments(operationSpec, request, pathParams, body); } -function loadRequestBodyIfNeeded( +async function loadRequestBodyIfNeeded( operationSpec: OperationObject, request: ServerRequest, ): Promise { @@ -68,15 +68,14 @@ function loadRequestBodyIfNeeded( const contentType = getContentType(request); if (contentType && !/json/.test(contentType)) { - const err = new HttpErrors.UnsupportedMediaType( + throw new HttpErrors.UnsupportedMediaType( `Content-type ${contentType} is not supported.`, ); - return Promise.reject(err); } - return parseJsonBody(request).catch((err: HttpError) => { + return await parseJsonBody(request).catch((err: HttpError) => { err.statusCode = 400; - return Promise.reject(err); + throw err; }); } From 63c2f372ad5071a10828db0535dee38a23377694 Mon Sep 17 00:00:00 2001 From: Paul Joey Clark Date: Tue, 17 Apr 2018 11:31:30 +0800 Subject: [PATCH 03/14] fix: fix lint error from prettier 1.12.1 --- packages/testlab/test/integration/test-sandbox.integration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/testlab/test/integration/test-sandbox.integration.ts b/packages/testlab/test/integration/test-sandbox.integration.ts index 88a01828f9ea..14f1d5be476a 100644 --- a/packages/testlab/test/integration/test-sandbox.integration.ts +++ b/packages/testlab/test/integration/test-sandbox.integration.ts @@ -118,7 +118,7 @@ describe('TestSandbox integration tests', () => { } async function deleteSandbox() { - if (!await pathExists(path)) return; + if (!(await pathExists(path))) return; await remove(sandbox.getPath()); } }); From 0ccd635570f327433af37c6688b2ce8db95298ed Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Wed, 18 Apr 2018 15:21:08 -0700 Subject: [PATCH 04/14] chore(build): upgrade dependencies --- packages/build/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/build/package.json b/packages/build/package.json index 5a0bd0c402e4..61e103e3ff59 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -18,14 +18,14 @@ "cross-spawn": "^6.0.5", "debug": "^3.1.0", "fs-extra": "^5.0.0", - "mocha": "^5.0.5", - "nyc": "^11.6.0", - "prettier": "^1.11.1", + "mocha": "^5.1.1", + "nyc": "^11.7.1", + "prettier": "^1.12.1", "rimraf": "^2.6.2", "source-map-support": "^0.5.4", "strong-docs": "^1.10.2", "tslint": "^5.9.1", - "typescript": "^2.6.2" + "typescript": "^2.8.1" }, "bin": { "lb-tsc": "./bin/compile-package.js", From 1ed79c9e5ab2f258f95cc4e539df87b58b790884 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Wed, 18 Apr 2018 15:17:29 -0700 Subject: [PATCH 05/14] feat: upgrade to openapi3-ts@0.11.0 The release of openapi3-ts@0.11.0 closes the gap of OAS 3.0 spec. This PR removes most of our own type declarations for the spec. --- packages/openapi-v3-types/package.json | 2 +- .../src/openapi-v3-spec-types.ts | 360 +----------------- .../test/unit/openapi-v3-spec-types.unit.ts | 4 +- packages/openapi-v3/src/controller-spec.ts | 4 +- packages/rest/src/http-handler.ts | 4 +- packages/rest/src/router/routing-table.ts | 6 +- 6 files changed, 12 insertions(+), 368 deletions(-) diff --git a/packages/openapi-v3-types/package.json b/packages/openapi-v3-types/package.json index 510af84d6629..3b4b406b1265 100644 --- a/packages/openapi-v3-types/package.json +++ b/packages/openapi-v3-types/package.json @@ -6,7 +6,7 @@ "node": ">=8" }, "dependencies": { - "openapi3-ts": "^0.8.0" + "openapi3-ts": "^0.11.0" }, "devDependencies": { "@loopback/build": "^0.5.0", diff --git a/packages/openapi-v3-types/src/openapi-v3-spec-types.ts b/packages/openapi-v3-types/src/openapi-v3-spec-types.ts index 310672f15ab3..a92f9c0963ca 100644 --- a/packages/openapi-v3-types/src/openapi-v3-spec-types.ts +++ b/packages/openapi-v3-types/src/openapi-v3-spec-types.ts @@ -6,14 +6,12 @@ /* * OpenApiSpec - A typescript representation of OpenApi 3.0.0 */ +import {OpenAPIObject} from 'openapi3-ts'; -// tslint:disable:max-line-length - -import * as OAS3 from 'openapi3-ts'; // Export spec interfaces from the community module if missing in our package export * from 'openapi3-ts'; -export type OpenApiSpec = OAS3.OpenAPIObject; +export type OpenApiSpec = OpenAPIObject; /** * Custom extensions can use arbitrary type as the value, * e.g. a string, an object or an array. @@ -21,360 +19,6 @@ export type OpenApiSpec = OAS3.OpenAPIObject; // tslint:disable-next-line:no-any export type ExtensionValue = any; -/** - * The location of a parameter. - * Possible values are "query", "header", "path" or "cookie". - * Specification: - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameter-locations - */ -export type ParameterLocation = 'query' | 'header' | 'path' | 'cookie'; - -/** - * The style of a parameter. - * Describes how the parameter value will be serialized. - * (serialization is not implemented yet) - * Specification: - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#style-values - */ -export type ParameterStyle = - | 'matrix' - | 'label' - | 'form' - | 'simple' - | 'spaceDelimited' - | 'pipeDelimited' - | 'deepObject'; - -/** - * The Schema Object allows the definition of input and output data types. - * the properties consist of two parts: - * - taken directly from the JSON Schema, is described by interface `JSONType` - * - taken from the JSON Schema, but definitions were adjusted to the - * OpenAPI Specification, is described by interface `OAS3SchemaObject` - */ -export interface SchemaObject extends JSONType, OAS3SchemaObject {} - -/** - * Part of OpenAPI Schema Object, The following properties are taken from the - * JSON Schema definition but their definitions were adjusted to the OpenAPI - * Specification. - */ -export interface OAS3SchemaObject extends ISpecificationExtension { - nullable?: boolean; - discriminator?: DiscriminatorObject; - readOnly?: boolean; - writeOnly?: boolean; - xml?: XMLObject; - externalDocs?: ExternalDocumentationObject; - example?: ExtensionValue; - examples?: ExtensionValue[]; - deprecated?: boolean; - - type?: string; - allOf?: (SchemaObject | ReferenceObject)[]; - oneOf?: (SchemaObject | ReferenceObject)[]; - anyOf?: (SchemaObject | ReferenceObject)[]; - not?: SchemaObject | ReferenceObject; - items?: SchemaObject | ReferenceObject; - properties?: {[propertyName: string]: SchemaObject | ReferenceObject}; - additionalProperties?: SchemaObject | ReferenceObject; - description?: string; - format?: string; - default?: ExtensionValue; -} - -/** - * JSON type - This is part of the Schema object. - * The following properties are taken directly from the JSON Schema - * definition and follow the same specifications. - * See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schema-object - */ - -export type JSONType = { - title?: string; - multipleOf?: number; - maximum?: number; - exclusiveMaximum?: number; - minimum?: number; - exclusiveMinimum?: number; - maxLength?: number; - minLength?: number; - // (This string SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect) - pattern?: string; - maxItems?: number; - minItems?: number; - uniqueItems?: boolean; - maxProperties?: number; - minProperties?: number; - enum?: Array; -}; - -/** - * Describes a single request body. - * Specification: - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#request-body-object - */ -export interface RequestBodyObject extends ISpecificationExtension { - description?: string; - content: ContentObject; - required?: boolean; -} - -/** - * Describes an object of multiple content types. - * For example: - * ```js - * { - * 'application/json': { - * schema: {...schemaObjectSpec} - * }, - * 'application/text': { - * schema: {...schemaObjectSpec} - * } - * } - * ``` - */ -export interface ContentObject { - [mediatype: string]: MediaTypeObject; -} - -/** - * Each Media Type Object provides schema and examples for the media type - * identified by its key. - * Specification: - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#media-type-object - */ -export interface MediaTypeObject extends ISpecificationExtension { - schema?: SchemaObject | ReferenceObject; - examples?: [ExampleObject | ReferenceObject]; - example?: ExampleObject | ReferenceObject; - encoding?: EncodingObject; -} - -/** - * Describes an encoding object, used in ParameterObject - */ -export interface EncodingObject extends ISpecificationExtension { - [property: string]: EncodingPropertyObject | ExtensionValue; -} - -/** - * Describes an encoding object, used in `SchemaObject` - */ -export interface EncodingPropertyObject { - contentType?: string; - headers?: {[key: string]: HeaderObject | ReferenceObject}; - style?: string; - explode?: boolean; - allowReserved?: boolean; - [key: string]: ExtensionValue; -} - -/** - * Describes a header object, used in `EncodingPropertyObject` - */ -export interface HeaderObject extends ParameterObject {} - -/** - * Describes a single operation parameter. - * A unique parameter is defined by a combination of a name and location. - * Specification - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameter-object - */ -export interface ParameterObject extends ISpecificationExtension { - name: string; - in: ParameterLocation; - description?: string; - required?: boolean; - deprecated?: boolean; - allowEmptyValue?: boolean; - - style?: ParameterStyle; - explode?: boolean; - allowReserved?: boolean; - schema?: SchemaObject | ReferenceObject; - examples?: {[param: string]: ExampleObject | ReferenceObject}; - example?: ExtensionValue; - content?: ContentObject; -} - -/** - * Describes an example object, used in `ParameterObject` - */ -export interface ExampleObject { - summary?: string; - description?: string; - value?: ExtensionValue; - externalValue?: string; - [property: string]: ExtensionValue; -} - -export interface ReferenceObject { - $ref: string; -} - -/** - * Describes a discriminator object, used in `SchemaObject` - */ -export interface DiscriminatorObject { - propertyName: string; - mapping?: {[key: string]: string}; -} - -/** - * Describes an XML object, used in `SchemaObject` - */ -export interface XMLObject extends ISpecificationExtension { - name?: string; - namespace?: string; - prefix?: string; - attribute?: boolean; - wrapped?: boolean; -} - -/** - * Describes an external document object, used in `SchemaObject` - */ -export interface ExternalDocumentationObject extends ISpecificationExtension { - description?: string; - url: string; -} - -/** - * Allow key(string) value extension specifications. - * These value extensions cannot be used as constraints, but can be filtered for retrieval. - */ -export interface ISpecificationExtension { - [extensionName: string]: ExtensionValue; -} - -/** - * Maps names to a given type of values - */ -export interface MapObject { - /** - * Maps between a name and object - */ - [name: string]: T; -} - -/** - * Schemas Object in components - */ -export interface SchemasObject extends MapObject { - [name: string]: SchemaObject; -} - -/** - * Lists the available scopes for an OAuth2 security scheme. - */ -export interface ScopesObject - extends MapObject, - ISpecificationExtension { - /** - * Maps between a name of a scope to a short description of it (as the value - * of the property). - */ - [name: string]: string; -} - -/** - * A declaration of the security schemes available to be used in the - * specification. This does not enforce the security schemes on the operations - * and only serves to provide the relevant details for each scheme. - */ -export interface SecurityDefinitionsObject - extends MapObject { - /** - * A single security scheme definition, mapping a "name" to the scheme it - * defines. - */ - [name: string]: OAS3.SecuritySchemeObject; -} - -/** - * An object to hold parameters to be reused across operations. Parameter - * definitions can be referenced to the ones defined here. - * - * This does not define global operation parameters. - */ -export interface ParametersDefinitionsObject - extends MapObject { - /** - * A single parameter definition, mapping a "name" to the parameter it - * defines. - */ - [name: string]: OAS3.ParameterObject; -} - -/** - * An object to hold responses to be reused across operations. Response - * definitions can be referenced to the ones defined here. - * - * This does not define global operation responses. - */ -export interface ResponsesDefinitionsObject - extends MapObject { - /** - * A single response definition, mapping a "name" to the response it defines. - */ - [name: string]: OAS3.ResponseObject; -} - -/** - * A container for the expected responses of an operation. - * The container maps a HTTP response code to the expected response. - * It is not expected from the documentation to necessarily cover all - * possible HTTP response codes, since they may not be known in advance. - * However, it is expected from the documentation to cover a successful - * operation response and any known errors. - * The `default` can be used as the default response object for all - * HTTP codes that are not covered individually by the specification. - * The `ResponsesObject` MUST contain at least one response code, - * and it SHOULD be the response for a successful operation call. - * Specification: - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responsesObject - */ -export interface ResponsesObject - extends MapObject, - ISpecificationExtension { - /** - * The documentation of responses other than the ones declared for specific - * HTTP response codes. It can be used to cover undeclared responses. - * Reference Object can be used to link to a response that is defined at - * the Swagger Object's responses section. - */ - default?: OAS3.ResponseObject | OAS3.ReferenceObject; -} - -/** - * Lists the headers that can be sent as part of a response. - */ -export interface HeadersObject extends MapObject { - /** - * The name of the property corresponds to the name of the header. The value - * describes the type of the header. - */ - [name: string]: OAS3.HeaderObject; -} - -/** - * Holds the relative paths to the individual endpoints. - * The path is appended to the basePath in order to construct the full URL. - * The Paths may be empty, due to ACL constraints. - * Specification: - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#paths-object - */ -export interface PathsObject - extends MapObject< - OAS3.PathItemObject | OAS3.ReferenceObject | ExtensionValue - > { - [httpPathOrSwaggerExtension: string]: - | OAS3.PathItemObject - | OAS3.ReferenceObject - | ExtensionValue; -} - /** * Create an empty OpenApiSpec object that's still a valid openapi document. */ diff --git a/packages/openapi-v3-types/test/unit/openapi-v3-spec-types.unit.ts b/packages/openapi-v3-types/test/unit/openapi-v3-spec-types.unit.ts index 55fb62807152..73848d1461ef 100644 --- a/packages/openapi-v3-types/test/unit/openapi-v3-spec-types.unit.ts +++ b/packages/openapi-v3-types/test/unit/openapi-v3-spec-types.unit.ts @@ -8,7 +8,7 @@ import { ExampleObject, ReferenceObject, DiscriminatorObject, - XMLObject, + XmlObject, ExternalDocumentationObject, ISpecificationExtension, createEmptyApiSpec, @@ -80,7 +80,7 @@ describe('openapi-v3-types unit tests', () => { } // tslint:disable-next-line:no-unused-variable - class XMLTestObject implements XMLObject { + class XMLTestObject implements XmlObject { name: 'test'; namespace: 'test'; prefix: 'test'; diff --git a/packages/openapi-v3/src/controller-spec.ts b/packages/openapi-v3/src/controller-spec.ts index 4fc10c610c15..c447b59b3bbd 100644 --- a/packages/openapi-v3/src/controller-spec.ts +++ b/packages/openapi-v3/src/controller-spec.ts @@ -8,7 +8,7 @@ import {MetadataInspector, DecoratorFactory} from '@loopback/context'; import { OperationObject, ParameterObject, - PathsObject, + PathObject, ComponentsObject, RequestBodyObject, } from '@loopback/openapi-v3-types'; @@ -32,7 +32,7 @@ export interface ControllerSpec { /** * The available paths and operations for the API. */ - paths: PathsObject; + paths: PathObject; /** * OpenAPI components.schemas generated from model metadata diff --git a/packages/rest/src/http-handler.ts b/packages/rest/src/http-handler.ts index 7538a3451521..a3e0dffa3a38 100644 --- a/packages/rest/src/http-handler.ts +++ b/packages/rest/src/http-handler.ts @@ -4,7 +4,7 @@ // License text available at https://opensource.org/licenses/MIT import {Context} from '@loopback/context'; -import {PathsObject, SchemasObject} from '@loopback/openapi-v3-types'; +import {PathObject, SchemasObject} from '@loopback/openapi-v3-types'; import {ServerRequest, ServerResponse} from 'http'; import {ControllerSpec} from '@loopback/openapi-v3'; @@ -54,7 +54,7 @@ export class HttpHandler { return this._apiDefinitions; } - describeApiPaths(): PathsObject { + describeApiPaths(): PathObject { return this._routes.describeApiPaths(); } diff --git a/packages/rest/src/router/routing-table.ts b/packages/rest/src/router/routing-table.ts index 8d42f9b9d6c6..8c166925ed4c 100644 --- a/packages/rest/src/router/routing-table.ts +++ b/packages/rest/src/router/routing-table.ts @@ -6,7 +6,7 @@ import { OperationObject, ParameterObject, - PathsObject, + PathObject, } from '@loopback/openapi-v3-types'; import { BindingScope, @@ -154,8 +154,8 @@ export class RoutingTable { this._routes.push(route); } - describeApiPaths(): PathsObject { - const paths: PathsObject = {}; + describeApiPaths(): PathObject { + const paths: PathObject = {}; for (const route of this._routes) { if (!paths[route.path]) { From 3a3c6faa82a5d22e5a89b9395a24c87daaff6fa9 Mon Sep 17 00:00:00 2001 From: Taranveer Virk Date: Fri, 20 Apr 2018 18:15:18 -0400 Subject: [PATCH 06/14] test: build loopback.io to validate docs package Co-Authored-By: Raymond Feng --- .travis.yml | 15 +++++++++++++++ bin/verify-docs.sh | 17 +++++++++++++++++ package.json | 2 ++ 3 files changed, 34 insertions(+) create mode 100755 bin/verify-docs.sh diff --git a/.travis.yml b/.travis.yml index f1af0851f037..4f35c1cb8702 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,21 @@ after_success: jobs: include: + - stage: loopback.io + before_install: + - | + if git diff --name-only --quiet $TRAVIS_BRANCH docs/; then + echo "No changes to @loopback/docs in this PR" + exit 0 + else + echo "Testing @loopback/docs" + fi + before_script: skip + script: + - npm run verify:docs + after_success: skip + os: + - linux - stage: commit linting before_install: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi diff --git a/bin/verify-docs.sh b/bin/verify-docs.sh new file mode 100755 index 000000000000..1769dea20c6b --- /dev/null +++ b/bin/verify-docs.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -ev + +# Make sure we use the correct repo root dir +DIR=`dirname $0` +REPO_ROOT=$DIR/.. +pushd $REPO_ROOT >/dev/null +rm -rf sandbox/loopback.io/ +# Shadow clone is faster +git clone --depth 1 https://github.com/strongloop/loopback.io.git sandbox/loopback.io +lerna bootstrap --scope loopback.io-workflow-scripts +pushd $REPO_ROOT/sandbox/loopback.io/ >/dev/null +bundle install +npm run build +popd >/dev/null +popd >/dev/null diff --git a/package.json b/package.json index 7e2cb53b276a..681b8838b86f 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,8 @@ "build:full": "npm run clean:lerna && npm run bootstrap && npm test", "pretest": "npm run clean && npm run build", "test": "node packages/build/bin/run-nyc npm run mocha --scripts-prepend-node-path", + "verify:docs": "npm run build:site && node packages/build/bin/run-clean \"sandbox/loopback.io\"", + "build:site": "./bin/verify-docs.sh", "mocha": "node packages/build/bin/run-mocha \"packages/*/DIST/test/**/*.js\" \"examples/*/DIST/test/**/*.js\" \"packages/cli/test/*.js\" \"packages/build/test/*/*.js\"", "posttest": "npm run lint" }, From 9daec91e5fe5933e28af20b3ed4ced28e895f4cb Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Mon, 23 Apr 2018 09:48:41 -0700 Subject: [PATCH 07/14] fix: update the script to build/verify docs with loopback.io The previous script rely on `packages/build` to clean up `loopback.io` directory after verification but it does not install deps of `@loopback/build`. --- bin/build-docs-site.sh | 46 ++++++++++++++++++++++++++++++++++++++++++ bin/verify-docs.sh | 17 ---------------- package.json | 4 ++-- 3 files changed, 48 insertions(+), 19 deletions(-) create mode 100755 bin/build-docs-site.sh delete mode 100755 bin/verify-docs.sh diff --git a/bin/build-docs-site.sh b/bin/build-docs-site.sh new file mode 100755 index 000000000000..b415d7c02e7c --- /dev/null +++ b/bin/build-docs-site.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# This script builds/verifies that `docs` is able to be served by `loopback.io` +# site. It runs the following steps: +# 1. Clone `strongloop/loopback.io` github repository into `sandbox` +# 2. Bootstrap `loopback.io` package using `lerna` to use `docs` folder for +# `@loopback/docs` dependency +# 3. Run `npm run build` for `loopback.io` module to make sure jekyll can +# generate the web site successfully + +# Set `-e` so that non-zero exit code from any step will be honored +set -e + +# Set `-v` (verbose) for travis build +if [ -n "$TRAVIS" ]; then + set -v +fi + +# Make sure we use the correct repo root dir +DIR=`dirname $0` +REPO_ROOT=$DIR/.. +pushd $REPO_ROOT >/dev/null + +# Clean up sandbox/loopback.io directory +rm -rf sandbox/loopback.io/ + +# Shadow clone the `strongloop/loopback.io` github repo +git clone --depth 1 https://github.com/strongloop/loopback.io.git sandbox/loopback.io + +# Bootstrap the `loopback.io` package +lerna bootstrap --scope loopback.io-workflow-scripts + +pushd $REPO_ROOT/sandbox/loopback.io/ >/dev/null + +# Run bundle install for ruby gems required for `loopback.io` +bundle install + +# Run npm build script to fetch readme files and generate jekyll site +npm run build + +popd >/dev/null +if [ "$1" == "--verify" ]; then +# Clean up sandbox/loopback.io/ if `--verify` + rm -rf sandbox/loopback.io/ +fi +popd >/dev/null diff --git a/bin/verify-docs.sh b/bin/verify-docs.sh deleted file mode 100755 index 1769dea20c6b..000000000000 --- a/bin/verify-docs.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -ev - -# Make sure we use the correct repo root dir -DIR=`dirname $0` -REPO_ROOT=$DIR/.. -pushd $REPO_ROOT >/dev/null -rm -rf sandbox/loopback.io/ -# Shadow clone is faster -git clone --depth 1 https://github.com/strongloop/loopback.io.git sandbox/loopback.io -lerna bootstrap --scope loopback.io-workflow-scripts -pushd $REPO_ROOT/sandbox/loopback.io/ >/dev/null -bundle install -npm run build -popd >/dev/null -popd >/dev/null diff --git a/package.json b/package.json index 681b8838b86f..fceaf27314b5 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,8 @@ "build:full": "npm run clean:lerna && npm run bootstrap && npm test", "pretest": "npm run clean && npm run build", "test": "node packages/build/bin/run-nyc npm run mocha --scripts-prepend-node-path", - "verify:docs": "npm run build:site && node packages/build/bin/run-clean \"sandbox/loopback.io\"", - "build:site": "./bin/verify-docs.sh", + "verify:docs": "npm run build:site -- --verify", + "build:site": "./bin/build-docs-site.sh", "mocha": "node packages/build/bin/run-mocha \"packages/*/DIST/test/**/*.js\" \"examples/*/DIST/test/**/*.js\" \"packages/cli/test/*.js\" \"packages/build/test/*/*.js\"", "posttest": "npm run lint" }, From 8373fb5ec6b5a454dd9055a946545b1ddb34243f Mon Sep 17 00:00:00 2001 From: Ali Mirlou Date: Mon, 23 Apr 2018 09:41:44 +0430 Subject: [PATCH 08/14] docs: fix link --- docs/site/Model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/site/Model.md b/docs/site/Model.md index 95c4fc63941d..181e19b9d5a6 100644 --- a/docs/site/Model.md +++ b/docs/site/Model.md @@ -132,7 +132,7 @@ class Product extends Entity { The complete list of valid attributes for property definitions can be found in LoopBack 3's -[Model definition section](https://loopback.io/doc/en/lb3/Model-definition-JSON-file.md#properties). +[Model definition section](https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html#properties). From c92603157ca7f08cf3748ca6bbd1e68da87d821e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 17 Apr 2018 10:57:32 +0200 Subject: [PATCH 09/14] build: move bootstrap to postinstall hook (#1264) Rework setup/build scripts to run "lerna bootstrap" as part of "npm install". The new setup simplifies our development workflow when changing branches. Instead of having to remember and type multiple npm scripts, one can run a single command: npm install-test # abbreviated as: npm it Under the hood, a new "postinstall" script is calling "lerna bootstrap" to install dependencies in individual packages. --- .travis.yml | 10 +++------- .vscode/tasks.json | 5 ++--- appveyor.yml | 2 +- docs/site/DEVELOPING.md | 2 +- package.json | 4 ++-- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f35c1cb8702..1ba0f27fc300 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,6 @@ os: git: depth: 300 -before_script: - - npm run bootstrap - -script: - - npm test - after_success: - npm run coverage:ci @@ -39,7 +33,9 @@ jobs: - stage: commit linting before_install: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - before_script: skip + # --ignore-scripts is disabling the postinstall script + # which would run relatively slow "lerna bootstrap" + install: npm install --ignore-scripts script: /bin/bash ./bin/lint-commits.sh after_success: skip os: diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 8e5d3d58636f..948f5a226b71 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -9,9 +9,8 @@ "command": "npm", "type": "shell", "args": [ - "run", - "-s", - "bootstrap" + "install", + "-s" ], "problemMatcher": [] }, diff --git a/appveyor.yml b/appveyor.yml index 2e737c78bd18..3ca79d8d9c19 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,7 @@ environment: install: - ps: Install-Product node $env:nodejs_version - - npm run bootstrap + - npm install test_script: - node --version diff --git a/docs/site/DEVELOPING.md b/docs/site/DEVELOPING.md index 7616813f0394..272d6bb718d2 100644 --- a/docs/site/DEVELOPING.md +++ b/docs/site/DEVELOPING.md @@ -53,7 +53,7 @@ command will install npm dependencies for all packages and create symbolic links for intra-dependencies: ```sh -npm run bootstrap +npm install ``` The next step is to compile all packages from TypeScript to JavaScript: diff --git a/package.json b/package.json index fceaf27314b5..ddf63a3da26e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "lerna": "^2.9.1" }, "scripts": { - "bootstrap": "npm i && lerna bootstrap", + "postinstall": "lerna bootstrap", "release": "npm run build:full && lerna publish", "update-template-deps": "node bin/update-template-deps -f", "version": "npm run update-template-deps && npm run apidocs", @@ -37,7 +37,7 @@ "clean": "lerna run clean && node packages/build/bin/run-clean \"packages/*/dist*\" \"examples/*/dist*\"", "clean:lerna": "lerna clean", "build": "node bin/run-lerna run build", - "build:full": "npm run clean:lerna && npm run bootstrap && npm test", + "build:full": "npm run clean:lerna && npm install && npm test", "pretest": "npm run clean && npm run build", "test": "node packages/build/bin/run-nyc npm run mocha --scripts-prepend-node-path", "verify:docs": "npm run build:site -- --verify", From 5dc4724a7eaabde3e8e940799f17139c1b97bd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Mon, 23 Apr 2018 11:40:56 +0200 Subject: [PATCH 10/14] refactor: clean usage of OAI's ExtensionValue Remove the definition of ExtensionValue from openapi-v3-types as it is no longer used. Remove Extendable type from openapi-spec-builder and use ISpecificationExtension from openapi3-ts instead. Fix openapi type guards to use a more correct `object` type instead of `ExtensionValue`, since the guards are not dealing with any extensions. Fix json-to-schema converter to use a different workaround for the compiler error related to accessing index properties on a type without any indexer. --- .../src/openapi-spec-builder.ts | 14 +++++++------- .../openapi-v3-types/src/openapi-v3-spec-types.ts | 6 ------ packages/openapi-v3-types/src/type-guards.ts | 8 ++------ packages/openapi-v3/src/json-to-schema.ts | 11 +++++------ 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/packages/openapi-spec-builder/src/openapi-spec-builder.ts b/packages/openapi-spec-builder/src/openapi-spec-builder.ts index cce3a7e40c29..3e80473ac2f7 100644 --- a/packages/openapi-spec-builder/src/openapi-spec-builder.ts +++ b/packages/openapi-spec-builder/src/openapi-spec-builder.ts @@ -5,13 +5,13 @@ import * as assert from 'assert'; import { - ExtensionValue, OpenApiSpec, OperationObject, ResponseObject, ParameterObject, createEmptyApiSpec, RequestBodyObject, + ISpecificationExtension, } from '@loopback/openapi-v3-types'; /** @@ -30,11 +30,7 @@ export function anOperationSpec() { return new OperationSpecBuilder(); } -export interface Extendable { - [extension: string]: ExtensionValue; -} - -export class BuilderBase { +export class BuilderBase { protected _spec: T; constructor(initialSpec: T) { @@ -47,7 +43,11 @@ export class BuilderBase { * @param key The property name starting with "x-". * @param value The property value. */ - withExtension(key: string, value: ExtensionValue): this { + withExtension( + key: string, + // tslint:disable-next-line:no-any + value: any, + ): this { assert( key.startsWith('x-'), `Invalid extension ${key}, extension keys must be prefixed with "x-"`, diff --git a/packages/openapi-v3-types/src/openapi-v3-spec-types.ts b/packages/openapi-v3-types/src/openapi-v3-spec-types.ts index a92f9c0963ca..abd618e6a0d0 100644 --- a/packages/openapi-v3-types/src/openapi-v3-spec-types.ts +++ b/packages/openapi-v3-types/src/openapi-v3-spec-types.ts @@ -12,12 +12,6 @@ import {OpenAPIObject} from 'openapi3-ts'; export * from 'openapi3-ts'; export type OpenApiSpec = OpenAPIObject; -/** - * Custom extensions can use arbitrary type as the value, - * e.g. a string, an object or an array. - */ -// tslint:disable-next-line:no-any -export type ExtensionValue = any; /** * Create an empty OpenApiSpec object that's still a valid openapi document. diff --git a/packages/openapi-v3-types/src/type-guards.ts b/packages/openapi-v3-types/src/type-guards.ts index 9dedbc3a90ad..4482487e24e8 100644 --- a/packages/openapi-v3-types/src/type-guards.ts +++ b/packages/openapi-v3-types/src/type-guards.ts @@ -3,11 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { - SchemaObject, - ReferenceObject, - ExtensionValue, -} from './openapi-v3-spec-types'; +import {SchemaObject, ReferenceObject} from './openapi-v3-spec-types'; /** * Type guard for OpenAPI 3.0.0 schema object @@ -20,6 +16,6 @@ export function isSchemaObject( return !schema.hasOwnProperty('$ref'); } -export function isReferenceObject(obj: ExtensionValue): obj is ReferenceObject { +export function isReferenceObject(obj: object): obj is ReferenceObject { return obj.hasOwnProperty('$ref'); } diff --git a/packages/openapi-v3/src/json-to-schema.ts b/packages/openapi-v3/src/json-to-schema.ts index ea017049bd64..2fafad3bbb77 100644 --- a/packages/openapi-v3/src/json-to-schema.ts +++ b/packages/openapi-v3/src/json-to-schema.ts @@ -4,11 +4,10 @@ // License text available at https://opensource.org/licenses/MIT import {JsonDefinition} from '@loopback/repository-json-schema'; -import {SchemaObject, ExtensionValue} from '@loopback/openapi-v3-types'; +import {SchemaObject} from '@loopback/openapi-v3-types'; import * as _ from 'lodash'; -export function jsonToSchemaObject(jsonDef: JsonDefinition): SchemaObject { - const json = jsonDef as {[name: string]: ExtensionValue}; // gets around index signature error +export function jsonToSchemaObject(json: JsonDefinition): SchemaObject { const result: SchemaObject = {}; const propsToIgnore = [ 'anyOf', @@ -63,7 +62,7 @@ export function jsonToSchemaObject(jsonDef: JsonDefinition): SchemaObject { case 'enum': { const newEnum = []; const primitives = ['string', 'number', 'boolean']; - for (const element of json.enum) { + for (const element of json.enum!) { if (primitives.includes(typeof element) || element === null) { newEnum.push(element); } else { @@ -76,14 +75,14 @@ export function jsonToSchemaObject(jsonDef: JsonDefinition): SchemaObject { break; } case '$ref': { - result.$ref = json.$ref.replace( + result.$ref = json.$ref!.replace( '#/definitions', '#/components/schemas', ); break; } default: { - result[property] = json[property]; + result[property] = json[property as keyof JsonDefinition]; break; } } From 49b9a8272998ab8a71bddf9fb0864bfa116e000c Mon Sep 17 00:00:00 2001 From: Taranveer Virk Date: Mon, 16 Apr 2018 21:26:08 -0400 Subject: [PATCH 11/14] feat(build): add an option to copy non ts files to outDir Copies non-.ts files (json, images, text, etc.) to the outDir (dist) so file paths can remain relative. Does so for the `include` directories listed in `tsconfig.json`. --- packages/build/README.md | 7 ++++- packages/build/bin/compile-package.js | 28 +++++++++++++++++++ packages/build/config/tsconfig.build.json | 2 +- packages/build/package.json | 1 + .../integration/test-sandbox.integration.ts | 6 +--- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/packages/build/README.md b/packages/build/README.md index 60b50ff9e304..b6af386ed978 100644 --- a/packages/build/README.md +++ b/packages/build/README.md @@ -51,7 +51,7 @@ Please remember to replace `your-module-name` with the name of your module. Now you run the scripts, such as: -- `npm run build` - Compile TypeScript files +- `npm run build` - Compile TypeScript files and copy resources (non `.ts` files) to outDir - `npm test` - Run all mocha tests - `npm run lint` - Run `tslint` and `prettier` on source files @@ -89,6 +89,11 @@ Now you run the scripts, such as: For more information, see . + - The following un-official compiler options are available: + |Option|Description| + |--|--| + |`--ignore-resources`|Do not copy any resources to outDir| + - lb-tslint By default, `lb-tslint` searches your project's root directory for diff --git a/packages/build/bin/compile-package.js b/packages/build/bin/compile-package.js index 7f2250328861..fd9cce4edacd 100755 --- a/packages/build/bin/compile-package.js +++ b/packages/build/bin/compile-package.js @@ -21,6 +21,8 @@ function run(argv, options) { const utils = require('./utils'); const path = require('path'); const fs = require('fs'); + const glob = require('glob'); + const fse = require('fs-extra'); const packageDir = utils.getPackageDir(); @@ -29,9 +31,19 @@ function run(argv, options) { const isTargetSet = utils.isOptionSet(compilerOpts, '--target'); const isOutDirSet = utils.isOptionSet(compilerOpts, '--outDir'); const isProjectSet = utils.isOptionSet(compilerOpts, '-p', '--project'); + const isIgnoreResourcesSet = utils.isOptionSet( + compilerOpts, + '--ignore-resources' + ); var target; + // --ignore-resources is not a TS Compiler option so we remove it from the + // list of compiler options to avoid compiler errors. + if (isIgnoreResourcesSet) { + compilerOpts.splice(compilerOpts.indexOf('--ignore-resources'), 1); + } + if (!isTargetSet) { // Find the last non-option argument as the `target` // For example `-p tsconfig.json es2017` or `es2017 -p tsconfig.json` @@ -110,6 +122,22 @@ function run(argv, options) { if (outDir) { args.push('--outDir', outDir); + + // Since outDir is set, ts files are compiled into that directory. + // If ignore-resources flag is not passed, copy resources (non-ts files) + // to the same outDir as well. + if (rootDir && tsConfigFile && !isIgnoreResourcesSet) { + const tsConfig = require(tsConfigFile); + const dirs = tsConfig.include + ? tsConfig.include.join('|') + : ['src', 'test'].join('|'); + + const pattern = `@(${dirs})/**/!(*.ts)`; + const files = glob.sync(pattern, {root: packageDir, nodir: true}); + for (const file of files) { + fse.copySync(path.join(packageDir, file), path.join(outDir, file)); + } + } } if (target) { diff --git a/packages/build/config/tsconfig.build.json b/packages/build/config/tsconfig.build.json index 6f7ce669259c..5ac79d53dbc7 100644 --- a/packages/build/config/tsconfig.build.json +++ b/packages/build/config/tsconfig.build.json @@ -7,5 +7,5 @@ "src", "test" ], - "exclude": ["node_modules/**", "packages/*/node_modules/**", "examples/*/node_modules/**", "**/*.d.ts"] + "exclude": ["node_modules/**", "**/*.d.ts"] } diff --git a/packages/build/package.json b/packages/build/package.json index 61e103e3ff59..c4a96a193856 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -18,6 +18,7 @@ "cross-spawn": "^6.0.5", "debug": "^3.1.0", "fs-extra": "^5.0.0", + "glob": "^7.1.2", "mocha": "^5.1.1", "nyc": "^11.7.1", "prettier": "^1.12.1", diff --git a/packages/testlab/test/integration/test-sandbox.integration.ts b/packages/testlab/test/integration/test-sandbox.integration.ts index 14f1d5be476a..e08ee57b9ef8 100644 --- a/packages/testlab/test/integration/test-sandbox.integration.ts +++ b/packages/testlab/test/integration/test-sandbox.integration.ts @@ -11,11 +11,7 @@ describe('TestSandbox integration tests', () => { let sandbox: TestSandbox; let path: string; const COPY_FILE = 'copy-me.txt'; - const COPY_FILE_PATH = resolve( - __dirname, - '../../../test/fixtures', - COPY_FILE, - ); + const COPY_FILE_PATH = resolve(__dirname, '../fixtures', COPY_FILE); beforeEach(createSandbox); beforeEach(givenPath); From afe72ad06777daf3fc9e838223c3aba4c75a15c3 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Wed, 25 Apr 2018 08:39:09 -0700 Subject: [PATCH 12/14] chore: make the code compatible with node 10.0.0 - Replace new Buffer() with Buffer.from() - Work around https://github.com/nodejs/node/issues/20278 - Upgrade to source-map-support@0.5.5 --- .../test/acceptance/basic-auth.acceptance.ts | 4 ++-- packages/boot/src/booters/booter-utils.ts | 11 ++++++---- packages/build/package.json | 2 +- .../repository/test/unit/type/type.unit.ts | 20 +++++++++---------- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/packages/authentication/test/acceptance/basic-auth.acceptance.ts b/packages/authentication/test/acceptance/basic-auth.acceptance.ts index 46c0a5f0fda7..cb26a4d569b7 100644 --- a/packages/authentication/test/acceptance/basic-auth.acceptance.ts +++ b/packages/authentication/test/acceptance/basic-auth.acceptance.ts @@ -48,7 +48,7 @@ describe('Basic Authentication', () => { const client = whenIMakeRequestTo(server); const credential = users.list.joe.profile.id + ':' + users.list.joe.password; - const hash = new Buffer(credential).toString('base64'); + const hash = Buffer.from(credential).toString('base64'); await client .get('/whoAmI') .set('Authorization', 'Basic ' + hash) @@ -58,7 +58,7 @@ describe('Basic Authentication', () => { it('returns error for invalid credentials', async () => { const client = whenIMakeRequestTo(server); const credential = users.list.Simpson.profile.id + ':' + 'invalid'; - const hash = new Buffer(credential).toString('base64'); + const hash = Buffer.from(credential).toString('base64'); await client .get('/whoAmI') .set('Authorization', 'Basic ' + hash) diff --git a/packages/boot/src/booters/booter-utils.ts b/packages/boot/src/booters/booter-utils.ts index 6d5fb85bb08b..db5024ce85b5 100644 --- a/packages/boot/src/booters/booter-utils.ts +++ b/packages/boot/src/booters/booter-utils.ts @@ -45,10 +45,13 @@ export function isClass(target: any): target is Constructor { export function loadClassesFromFiles(files: string[]): Constructor<{}>[] { const classes: Array> = []; for (const file of files) { - const data = require(file); - for (const cls of Object.values(data)) { - if (isClass(cls)) { - classes.push(cls); + const moduleObj = require(file); + // WORKAROUND: use `for in` instead of Object.values(). + // See https://github.com/nodejs/node/issues/20278 + for (const k in moduleObj) { + const exported = moduleObj[k]; + if (isClass(exported)) { + classes.push(exported); } } } diff --git a/packages/build/package.json b/packages/build/package.json index c4a96a193856..84564a58a65e 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -23,7 +23,7 @@ "nyc": "^11.7.1", "prettier": "^1.12.1", "rimraf": "^2.6.2", - "source-map-support": "^0.5.4", + "source-map-support": "^0.5.5", "strong-docs": "^1.10.2", "tslint": "^5.9.1", "typescript": "^2.8.1" diff --git a/packages/repository/test/unit/type/type.unit.ts b/packages/repository/test/unit/type/type.unit.ts index 8fc816652651..57af97603d59 100644 --- a/packages/repository/test/unit/type/type.unit.ts +++ b/packages/repository/test/unit/type/type.unit.ts @@ -231,8 +231,8 @@ describe('types', () => { describe('buffer', () => { const bufferType = new types.BufferType(); it('checks isInstance', () => { - expect(bufferType.isInstance(new Buffer([1]))).to.be.true(); - expect(bufferType.isInstance(new Buffer('123'))).to.be.true(); + expect(bufferType.isInstance(Buffer.from([1]))).to.be.true(); + expect(bufferType.isInstance(Buffer.from('123'))).to.be.true(); expect(bufferType.isInstance('str')).to.be.false(); expect(bufferType.isInstance(null)).to.be.true(); expect(bufferType.isInstance(undefined)).to.be.true(); @@ -248,7 +248,7 @@ describe('types', () => { expect(bufferType.isCoercible('str')).to.be.true(); expect(bufferType.isCoercible(null)).to.be.true(); expect(bufferType.isCoercible(undefined)).to.be.true(); - expect(bufferType.isCoercible(new Buffer('12'))).to.be.true(); + expect(bufferType.isCoercible(Buffer.from('12'))).to.be.true(); expect(bufferType.isCoercible([1, 2])).to.be.true(); expect(bufferType.isCoercible({x: 1})).to.be.false(); expect(bufferType.isCoercible(1)).to.be.false(); @@ -260,11 +260,11 @@ describe('types', () => { }); it('coerces values', () => { - expect(bufferType.coerce('str').equals(new Buffer('str'))).to.be.true(); + expect(bufferType.coerce('str').equals(Buffer.from('str'))).to.be.true(); expect(bufferType.coerce([1]).equals(Buffer.from([1]))).to.be.true(); expect(bufferType.coerce(null)).to.equal(null); expect(bufferType.coerce(undefined)).to.equal(undefined); - const buf = new Buffer('12'); + const buf = Buffer.from('12'); expect(bufferType.coerce(buf)).exactly(buf); expect(() => bufferType.coerce(1)).to.throw(/Invalid buffer/); expect(() => bufferType.coerce(new Date())).to.throw(/Invalid buffer/); @@ -274,9 +274,9 @@ describe('types', () => { it('serializes values', () => { expect( - bufferType.serialize(new Buffer('str'), {encoding: 'utf-8'}), + bufferType.serialize(Buffer.from('str'), {encoding: 'utf-8'}), ).to.eql('str'); - expect(bufferType.serialize(new Buffer('str'))).to.eql('c3Ry'); + expect(bufferType.serialize(Buffer.from('str'))).to.eql('c3Ry'); expect(bufferType.serialize(null)).null(); expect(bufferType.serialize(undefined)).undefined(); }); @@ -293,7 +293,7 @@ describe('types', () => { expect(anyType.isInstance([1, 2])).to.be.true(); expect(anyType.isInstance(1)).to.be.true(); expect(anyType.isInstance(new Date())).to.be.true(); - expect(anyType.isInstance(new Buffer('123'))).to.be.true(); + expect(anyType.isInstance(Buffer.from('123'))).to.be.true(); }); it('checks isCoercible', () => { @@ -305,7 +305,7 @@ describe('types', () => { expect(anyType.isCoercible(1)).to.be.true(); expect(anyType.isCoercible([1, '2'])).to.be.true(); expect(anyType.isCoercible(new Date())).to.be.true(); - expect(anyType.isCoercible(new Buffer('123'))).to.be.true(); + expect(anyType.isCoercible(Buffer.from('123'))).to.be.true(); }); it('creates defaultValue', () => { @@ -324,7 +324,7 @@ describe('types', () => { expect(anyType.coerce(1)).to.equal(1); const date = new Date(); expect(anyType.coerce(date)).to.equal(date); - const buf = new Buffer('12'); + const buf = Buffer.from('12'); expect(anyType.coerce(buf)).to.equal(buf); }); From 715cc91b1787a48772717d941602cb2704a1a2fe Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Tue, 24 Apr 2018 15:02:30 -0700 Subject: [PATCH 13/14] feat(cli): improve cli help/version/commands options --- packages/cli/README.md | 38 +++++ packages/cli/bin/cli.js | 147 ++++++++++++------ packages/cli/package.json | 36 ++--- .../cli/test/acceptance/app-run.acceptance.js | 2 +- .../test/integration/cli/cli.integration.js | 52 +++++++ 5 files changed, 207 insertions(+), 68 deletions(-) create mode 100644 packages/cli/test/integration/cli/cli.integration.js diff --git a/packages/cli/README.md b/packages/cli/README.md index c58be59ff654..f6f8ad174ac7 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -90,6 +90,44 @@ Options: --skip-install # Do not automatically install dependencies Default: false ``` +5. To list available commands + + `lb4 --commands` (or `lb4 -l`) + +```sh +Available commands: + lb4 app + lb4 extension + lb4 controller + lb4 example +``` + +Please note `lb4 --help` also prints out available commands. + +6. To print out version information + + `lb4 --version` (or `lb4 -v`) + +```sh +@loopback/cli version: 0.8.0 + +@loopback/* dependencies: + - @loopback/authentication: ^0.8.0 + - @loopback/boot: ^0.8.0 + - @loopback/build: ^0.5.0 + - @loopback/context: ^0.8.0 + - @loopback/core: ^0.6.0 + - @loopback/metadata: ^0.6.0 + - @loopback/openapi-spec-builder: ^0.5.0 + - @loopback/openapi-v3-types: ^0.4.0 + - @loopback/openapi-v3: ^0.7.0 + - @loopback/repository-json-schema: ^0.6.0 + - @loopback/repository: ^0.8.0 + - @loopback/rest: ^0.7.0 + - @loopback/testlab: ^0.7.0 + - @loopback/docs: ^0.5.0 +``` + ## Contributions - [Guidelines](https://github.com/strongloop/loopback-next/blob/master/docs/CONTRIBUTING.md) diff --git a/packages/cli/bin/cli.js b/packages/cli/bin/cli.js index 1d8ca056c61a..9b87d15fd79e 100755 --- a/packages/cli/bin/cli.js +++ b/packages/cli/bin/cli.js @@ -12,64 +12,117 @@ const debug = require('../lib/debug')(); const minimist = require('minimist'); const path = require('path'); const yeoman = require('yeoman-environment'); +const PREFIX = 'loopback4:'; -const opts = minimist(process.argv.slice(2), { - alias: { - version: 'v', - commands: 'l', - }, -}); - -if (opts.version) { - const ver = require('../package.json').version; - console.log('Version: %s', ver); - return; +/** + * Parse arguments and run corresponding command + * @param env Yeoman env + * @param {*} opts Command options + * @param log Log function + * @param dryRun flag for dryRun (for testing) + */ +function runCommand(env, opts, log, dryRun) { + const args = opts._; + const originalCommand = args.shift(); + let command = PREFIX + (originalCommand || 'app'); + const supportedCommands = env.getGeneratorsMeta(); + if (!(command in supportedCommands)) { + command = PREFIX + 'app'; + args.unshift(originalCommand); + args.unshift(command); + } else { + args.unshift(command); + } + debug('invoking generator', args); + // `yo` is adding flags converted to CamelCase + const options = camelCaseKeys(opts, {exclude: ['--', /^\w$/, 'argv']}); + Object.assign(options, opts); + debug('env.run %j %j', args, options); + if (!dryRun) { + env.run(args, options); + } + // list generators + if (opts.help && !originalCommand) { + printCommands(env, log); + } } -var env = yeoman.createEnv(); +/** + * Set up yeoman generators + */ +function setupGenerators() { + var env = yeoman.createEnv(); + env.register(path.join(__dirname, '../generators/app'), PREFIX + 'app'); + env.register( + path.join(__dirname, '../generators/extension'), + PREFIX + 'extension' + ); + env.register( + path.join(__dirname, '../generators/controller'), + PREFIX + 'controller' + ); + env.register( + path.join(__dirname, '../generators/example'), + PREFIX + 'example' + ); + return env; +} -env.register(path.join(__dirname, '../generators/app'), 'loopback4:app'); -env.register( - path.join(__dirname, '../generators/extension'), - 'loopback4:extension' -); -env.register( - path.join(__dirname, '../generators/controller'), - 'loopback4:controller' -); -env.register( - path.join(__dirname, '../generators/example'), - 'loopback4:example' -); +/** + * Print @loopback/* versions + */ +function printVersions(log) { + const pkg = require('../package.json'); + const ver = pkg.version; + log('@loopback/cli version: %s', ver); + const deps = pkg.config.templateDependencies; + log('\n@loopback/* dependencies:'); + for (const d in deps) { + if (d.startsWith('@loopback/') && d !== '@loopback/cli') { + log(' - %s: %s', d, deps[d]); + } + } +} -// list generators -if (opts.commands) { - console.log('Available commands: '); +/** + * Print a list of available commands + * @param {*} env Yeoman env + * @param log Log function + */ +function printCommands(env, log) { + log('Available commands: '); var list = Object.keys(env.getGeneratorsMeta()) .filter(name => /^loopback4:/.test(name)) .map(name => name.replace(/^loopback4:/, ' lb4 ')); - console.log(list.join('\n')); - return; + log(list.join('\n')); } -const args = opts._; -const originalCommand = args.shift(); -let command = 'loopback4:' + (originalCommand || 'app'); -const supportedCommands = env.getGeneratorsMeta(); +function main(opts, log, dryRun) { + log = log || console.log; + if (opts.version) { + printVersions(log); + return; + } -if (!(command in supportedCommands)) { - command = 'loopback4:app'; - args.unshift(originalCommand); - args.unshift(command); -} else { - args.unshift(command); -} + var env = setupGenerators(); -debug('invoking generator', args); + // list generators + if (opts.commands) { + printCommands(env, log); + return; + } -// `yo` is adding flags converted to CamelCase -const options = camelCaseKeys(opts, {exclude: ['--', /^\w$/, 'argv']}); -Object.assign(options, opts); + runCommand(env, opts, log, dryRun); +} + +module.exports = main; -debug('env.run %j %j', args, options); -env.run(args, options); +if (require.main === module) { + const opts = minimist(process.argv.slice(2), { + alias: { + version: 'v', // --version or -v: print versions + commands: 'l', // --commands or -l: print commands + }, + }); + main(opts); +} diff --git a/packages/cli/package.json b/packages/cli/package.json index 8a55a4f885af..5feeb77375fc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -65,38 +65,34 @@ }, "config": { "templateDependencies": { - "//1": "This file contains dependency/version used by project templates", - "//2": "It can be updated by `npm run update-template-deps` under `loopback-next`", - "@loopback/context": "^0.8.0", - "@loopback/boot": "^0.8.0", - "@loopback/core": "^0.6.0", - "@loopback/rest": "^0.7.0", - "@loopback/openapi-v3": "^0.7.0", - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", "@types/mocha": "^5.0.0", "@types/node": "^8.10.4", - "mocha": "^5.0.5", - "source-map-support": "^0.5.4", - "prettier": "^1.11.1", - "tslint": "^5.9.1", - "typescript": "^2.6.2", "cross-spawn": "^6.0.5", "debug": "^3.1.0", - "nyc": "^11.6.0", + "fs-extra": "^5.0.0", + "mocha": "^5.1.1", + "nyc": "^11.7.1", + "prettier": "^1.12.1", + "rimraf": "^2.6.2", + "source-map-support": "^0.5.4", "strong-docs": "^1.10.2", + "tslint": "^5.9.1", + "typescript": "^2.8.1", "@loopback/authentication": "^0.8.0", + "@loopback/boot": "^0.8.0", + "@loopback/build": "^0.5.0", "@loopback/cli": "^0.8.0", + "@loopback/context": "^0.8.0", + "@loopback/core": "^0.6.0", "@loopback/metadata": "^0.6.0", "@loopback/openapi-spec-builder": "^0.5.0", - "@loopback/openapi-spec": "^0.3.0", "@loopback/openapi-v3-types": "^0.4.0", + "@loopback/openapi-v3": "^0.7.0", "@loopback/repository-json-schema": "^0.6.0", "@loopback/repository": "^0.8.0", - "@loopback/openapi-v2": "^0.3.0", - "@loopback/docs": "^0.5.0", - "fs-extra": "^5.0.0", - "rimraf": "^2.6.2" + "@loopback/rest": "^0.7.0", + "@loopback/testlab": "^0.7.0", + "@loopback/docs": "^0.5.0" } }, "copyright.owner": "IBM Corp.", diff --git a/packages/cli/test/acceptance/app-run.acceptance.js b/packages/cli/test/acceptance/app-run.acceptance.js index 5713da5cda16..4a59d3df566a 100644 --- a/packages/cli/test/acceptance/app-run.acceptance.js +++ b/packages/cli/test/acceptance/app-run.acceptance.js @@ -14,7 +14,7 @@ const build = require('@loopback/build'); describe('app-generator (SLOW)', function() { const generator = path.join(__dirname, '../../generators/app'); const rootDir = path.join(__dirname, '../../../..'); - const sandbox = path.join(__dirname, '../../sandbox/sandbox-app'); + const sandbox = path.join(rootDir, 'sandbox/sandbox-app'); const cwd = process.cwd(); const appName = '@loopback/sandbox-app'; const props = { diff --git a/packages/cli/test/integration/cli/cli.integration.js b/packages/cli/test/integration/cli/cli.integration.js new file mode 100644 index 000000000000..277f9c32b069 --- /dev/null +++ b/packages/cli/test/integration/cli/cli.integration.js @@ -0,0 +1,52 @@ +// Copyright IBM Corp. 2017,2018. All Rights Reserved. +// Node module: @loopback/cli +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +'use strict'; + +const expect = require('@loopback/testlab').expect; +const util = require('util'); +const main = require('../../../bin/cli'); + +function getLog(buffer) { + buffer = buffer || []; + return function(format, ...params) { + buffer.push(util.format(format, ...params)); + return buffer; + }; +} + +describe('cli', () => { + it('lists available commands', () => { + const entries = []; + main({commands: true}, getLog(entries)); + expect(entries).to.eql([ + 'Available commands: ', + ' lb4 app\n lb4 extension\n lb4 controller\n lb4 example', + ]); + }); + + it('lists versions', () => { + const entries = []; + main({version: true}, getLog(entries)); + const logs = entries.join(''); + expect(logs).to.match(/@loopback\/cli version\:/); + expect(logs).to.match(/@loopback\/\* dependencies:/); + }); + + it('prints commands with --help', () => { + const entries = []; + main({help: true, _: []}, getLog(entries)); + expect(entries).to.containEql('Available commands: '); + expect(entries).to.containEql( + ' lb4 app\n lb4 extension\n lb4 controller\n lb4 example' + ); + }); + + it('does not print commands with --help for a given command', () => { + const entries = []; + main({help: true, _: ['app']}, getLog(entries), true); + expect(entries).to.not.containEql('Available commands: '); + }); +}); From 278d452d3f5e70e74ccebc4d648df7d6eef1292c Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Wed, 25 Apr 2018 13:36:10 -0700 Subject: [PATCH 14/14] chore: publish release - @loopback/authentication@0.8.1 - @loopback/boot@0.8.1 - @loopback/build@0.6.0 - @loopback/cli@0.9.0 - @loopback/context@0.8.1 - @loopback/core@0.6.1 - @loopback/metadata@0.6.1 - @loopback/openapi-spec-builder@0.5.1 - @loopback/openapi-v3-types@0.5.0 - @loopback/openapi-v3@0.8.0 - @loopback/repository-json-schema@0.6.1 - @loopback/repository@0.8.1 - @loopback/rest@0.8.0 - @loopback/testlab@0.8.0 - @loopback/example-hello-world@0.5.1 - @loopback/example-log-extension@0.7.1 - @loopback/example-rpc-server@0.5.1 - @loopback/example-todo@0.7.1 - @loopback/docs@0.5.1 --- docs/CHANGELOG.md | 8 ++++ docs/package.json | 2 +- examples/hello-world/CHANGELOG.md | 8 ++++ examples/hello-world/package.json | 8 ++-- examples/log-extension/CHANGELOG.md | 8 ++++ examples/log-extension/package.json | 14 +++---- examples/rpc-server/CHANGELOG.md | 8 ++++ examples/rpc-server/package.json | 10 ++--- examples/todo/CHANGELOG.md | 8 ++++ examples/todo/package.json | 20 +++++----- packages/authentication/CHANGELOG.md | 8 ++++ packages/authentication/package.json | 16 ++++---- packages/boot/CHANGELOG.md | 8 ++++ packages/boot/package.json | 16 ++++---- packages/build/CHANGELOG.md | 11 ++++++ packages/build/package.json | 2 +- packages/cli/CHANGELOG.md | 11 ++++++ packages/cli/package.json | 39 ++++++++++---------- packages/context/CHANGELOG.md | 8 ++++ packages/context/package.json | 8 ++-- packages/core/CHANGELOG.md | 8 ++++ packages/core/package.json | 8 ++-- packages/metadata/CHANGELOG.md | 8 ++++ packages/metadata/package.json | 6 +-- packages/openapi-spec-builder/CHANGELOG.md | 8 ++++ packages/openapi-spec-builder/package.json | 6 +-- packages/openapi-v3-types/CHANGELOG.md | 11 ++++++ packages/openapi-v3-types/package.json | 6 +-- packages/openapi-v3/CHANGELOG.md | 11 ++++++ packages/openapi-v3/package.json | 16 ++++---- packages/repository-json-schema/CHANGELOG.md | 8 ++++ packages/repository-json-schema/package.json | 10 ++--- packages/repository/CHANGELOG.md | 8 ++++ packages/repository/package.json | 10 ++--- packages/rest/CHANGELOG.md | 11 ++++++ packages/rest/package.json | 18 ++++----- packages/testlab/CHANGELOG.md | 16 ++++++++ packages/testlab/package.json | 4 +- 38 files changed, 285 insertions(+), 109 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a40800722807..9b771bb22245 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.5.1](https://github.com/strongloop/loopback-next/compare/@loopback/docs@0.5.0...@loopback/docs@0.5.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/docs + # [0.5.0](https://github.com/strongloop/loopback-next/compare/@loopback/docs@0.4.3...@loopback/docs@0.5.0) (2018-04-16) diff --git a/docs/package.json b/docs/package.json index 5cf3f7ed02f6..728b85184b48 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/docs", - "version": "0.5.0", + "version": "0.5.1", "description": "Documentation for LoopBack 4", "homepage": "https://github.com/strongloop/loopback-next/tree/master/docs", "author": { diff --git a/examples/hello-world/CHANGELOG.md b/examples/hello-world/CHANGELOG.md index 9e5f77f6c10d..264074e224c9 100644 --- a/examples/hello-world/CHANGELOG.md +++ b/examples/hello-world/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.5.1](https://github.com/strongloop/loopback-next/compare/@loopback/example-hello-world@0.5.0...@loopback/example-hello-world@0.5.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/example-hello-world + # [0.5.0](https://github.com/strongloop/loopback-next/compare/@loopback/example-hello-world@0.4.7...@loopback/example-hello-world@0.5.0) (2018-04-16) diff --git a/examples/hello-world/package.json b/examples/hello-world/package.json index 5d4d2a82199f..0f2cb407b7e9 100644 --- a/examples/hello-world/package.json +++ b/examples/hello-world/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/example-hello-world", - "version": "0.5.0", + "version": "0.5.1", "description": "A simple hello-world Application using LoopBack 4", "private": true, "main": "index.js", @@ -21,11 +21,11 @@ }, "license": "MIT", "dependencies": { - "@loopback/core": "^0.6.0", - "@loopback/rest": "^0.7.0" + "@loopback/core": "^0.6.1", + "@loopback/rest": "^0.8.0" }, "devDependencies": { - "@loopback/build": "^0.5.0", + "@loopback/build": "^0.6.0", "@types/node": "^8.10.4" }, "keywords": [ diff --git a/examples/log-extension/CHANGELOG.md b/examples/log-extension/CHANGELOG.md index 22c8be601fb6..3919c1911ad1 100644 --- a/examples/log-extension/CHANGELOG.md +++ b/examples/log-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.7.1](https://github.com/strongloop/loopback-next/compare/@loopback/example-log-extension@0.7.0...@loopback/example-log-extension@0.7.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/example-log-extension + # [0.7.0](https://github.com/strongloop/loopback-next/compare/@loopback/example-log-extension@0.6.3...@loopback/example-log-extension@0.7.0) (2018-04-16) diff --git a/examples/log-extension/package.json b/examples/log-extension/package.json index 26b8bbaaadec..59da9fda0e6e 100644 --- a/examples/log-extension/package.json +++ b/examples/log-extension/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/example-log-extension", - "version": "0.7.0", + "version": "0.7.1", "description": "An example extension project for LoopBack 4", "private": true, "main": "index.js", @@ -38,17 +38,17 @@ }, "homepage": "https://github.com/strongloop/loopback-next/tree/master/examples/log-extension", "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/debug": "0.0.30", "@types/node": "^8.10.4", "source-map-support": "^0.5.4" }, "dependencies": { - "@loopback/context": "^0.8.0", - "@loopback/core": "^0.6.0", - "@loopback/openapi-v3": "^0.7.0", - "@loopback/rest": "^0.7.0", + "@loopback/context": "^0.8.1", + "@loopback/core": "^0.6.1", + "@loopback/openapi-v3": "^0.8.0", + "@loopback/rest": "^0.8.0", "chalk": "^2.3.2", "debug": "^3.1.0" } diff --git a/examples/rpc-server/CHANGELOG.md b/examples/rpc-server/CHANGELOG.md index 073ae86d154f..cbfee3ae9e0b 100644 --- a/examples/rpc-server/CHANGELOG.md +++ b/examples/rpc-server/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.5.1](https://github.com/strongloop/loopback-next/compare/@loopback/example-rpc-server@0.5.0...@loopback/example-rpc-server@0.5.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/example-rpc-server + # [0.5.0](https://github.com/strongloop/loopback-next/compare/@loopback/example-rpc-server@0.4.6...@loopback/example-rpc-server@0.5.0) (2018-04-16) diff --git a/examples/rpc-server/package.json b/examples/rpc-server/package.json index 74f68059079c..ee86af2f2148 100644 --- a/examples/rpc-server/package.json +++ b/examples/rpc-server/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/example-rpc-server", - "version": "0.5.0", + "version": "0.5.1", "description": "A basic RPC server using a made-up protocol.", "private": true, "keywords": [ @@ -39,14 +39,14 @@ "dist" ], "dependencies": { - "@loopback/context": "^0.8.0", - "@loopback/core": "^0.6.0", + "@loopback/context": "^0.8.1", + "@loopback/core": "^0.6.1", "express": "^4.16.3", "p-event": "^1.3.0" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/express": "^4.11.1", "@types/node": "^8.10.4", "@types/p-event": "^1.3.0", diff --git a/examples/todo/CHANGELOG.md b/examples/todo/CHANGELOG.md index a5da056df574..6446d55cd0e1 100644 --- a/examples/todo/CHANGELOG.md +++ b/examples/todo/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.7.1](https://github.com/strongloop/loopback-next/compare/@loopback/example-todo@0.7.0...@loopback/example-todo@0.7.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/example-todo + # [0.7.0](https://github.com/strongloop/loopback-next/compare/@loopback/example-todo@0.6.3...@loopback/example-todo@0.7.0) (2018-04-16) diff --git a/examples/todo/package.json b/examples/todo/package.json index 22d222c1d699..b984529e82f1 100644 --- a/examples/todo/package.json +++ b/examples/todo/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/example-todo", - "version": "0.7.0", + "version": "0.7.1", "description": "Tutorial example on how to build an application with LoopBack 4.", "private": true, "main": "index.js", @@ -24,17 +24,17 @@ }, "license": "MIT", "dependencies": { - "@loopback/boot": "^0.8.0", - "@loopback/context": "^0.8.0", - "@loopback/core": "^0.6.0", - "@loopback/openapi-v3": "^0.7.0", - "@loopback/openapi-v3-types": "^0.4.0", - "@loopback/repository": "^0.8.0", - "@loopback/rest": "^0.7.0" + "@loopback/boot": "^0.8.1", + "@loopback/context": "^0.8.1", + "@loopback/core": "^0.6.1", + "@loopback/openapi-v3": "^0.8.0", + "@loopback/openapi-v3-types": "^0.5.0", + "@loopback/repository": "^0.8.1", + "@loopback/rest": "^0.8.0" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/node": "^8.10.4", "source-map-support": "^0.5.4", "typescript": "^2.6.2" diff --git a/packages/authentication/CHANGELOG.md b/packages/authentication/CHANGELOG.md index 0279b8088cc3..6020a5114c8b 100644 --- a/packages/authentication/CHANGELOG.md +++ b/packages/authentication/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.8.1](https://github.com/strongloop/loopback-next/compare/@loopback/authentication@0.8.0...@loopback/authentication@0.8.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/authentication + # [0.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/authentication@0.7.1...@loopback/authentication@0.8.0) (2018-04-16) diff --git a/packages/authentication/package.json b/packages/authentication/package.json index b8277ccd5795..21acb7baa815 100644 --- a/packages/authentication/package.json +++ b/packages/authentication/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/authentication", - "version": "0.8.0", + "version": "0.8.1", "description": "A LoopBack component for authentication support.", "engines": { "node": ">=8" @@ -20,17 +20,17 @@ "copyright.owner": "IBM Corp.", "license": "MIT", "dependencies": { - "@loopback/context": "^0.8.0", - "@loopback/core": "^0.6.0", - "@loopback/openapi-v3": "^0.7.0", - "@loopback/rest": "^0.7.0", + "@loopback/context": "^0.8.1", + "@loopback/core": "^0.6.1", + "@loopback/openapi-v3": "^0.8.0", + "@loopback/rest": "^0.8.0", "passport": "^0.4.0", "passport-strategy": "^1.0.0" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/openapi-spec-builder": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/openapi-spec-builder": "^0.5.1", + "@loopback/testlab": "^0.8.0", "@types/node": "^8.10.4", "@types/passport": "^0.4.4", "@types/passport-http": "^0.3.6", diff --git a/packages/boot/CHANGELOG.md b/packages/boot/CHANGELOG.md index 7e8c645fae4c..7928c9a24de5 100644 --- a/packages/boot/CHANGELOG.md +++ b/packages/boot/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.8.1](https://github.com/strongloop/loopback-next/compare/@loopback/boot@0.8.0...@loopback/boot@0.8.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/boot + # [0.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/boot@0.7.2...@loopback/boot@0.8.0) (2018-04-16) diff --git a/packages/boot/package.json b/packages/boot/package.json index 7e208aa61564..64335b490a22 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/boot", - "version": "0.8.0", + "version": "0.8.1", "description": "A collection of Booters for LoopBack 4 Applications", "engines": { "node": ">=8" @@ -25,19 +25,19 @@ "copyright.owner": "IBM Corp.", "license": "MIT", "dependencies": { - "@loopback/context": "^0.8.0", - "@loopback/core": "^0.6.0", - "@loopback/repository": "^0.8.0", + "@loopback/context": "^0.8.1", + "@loopback/core": "^0.6.1", + "@loopback/repository": "^0.8.1", "@types/debug": "0.0.30", "@types/glob": "^5.0.35", "debug": "^3.1.0", "glob": "^7.1.2" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/openapi-v3": "^0.7.0", - "@loopback/rest": "^0.7.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/openapi-v3": "^0.8.0", + "@loopback/rest": "^0.8.0", + "@loopback/testlab": "^0.8.0", "@types/node": "^8.10.4" }, "files": [ diff --git a/packages/build/CHANGELOG.md b/packages/build/CHANGELOG.md index 8f59928e1796..a9173d4f9bd3 100644 --- a/packages/build/CHANGELOG.md +++ b/packages/build/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.6.0](https://github.com/strongloop/loopback-next/compare/@loopback/build@0.5.0...@loopback/build@0.6.0) (2018-04-25) + + +### Features + +* **build:** add an option to copy non ts files to outDir ([49b9a82](https://github.com/strongloop/loopback-next/commit/49b9a82)) + + + + # [0.5.0](https://github.com/strongloop/loopback-next/compare/@loopback/build@0.4.3...@loopback/build@0.5.0) (2018-04-16) diff --git a/packages/build/package.json b/packages/build/package.json index 84564a58a65e..aa0d94d5f3d7 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -5,7 +5,7 @@ "type": "git", "url": "https://github.com/strongloop/loopback-next.git" }, - "version": "0.5.0", + "version": "0.6.0", "engines": { "node": ">=8" }, diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 872f1d0aeaf7..16622e6098bf 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.9.0](https://github.com/strongloop/loopback-next/compare/@loopback/cli@0.8.0...@loopback/cli@0.9.0) (2018-04-25) + + +### Features + +* **cli:** improve cli help/version/commands options ([715cc91](https://github.com/strongloop/loopback-next/commit/715cc91)) + + + + # [0.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/cli@0.7.4...@loopback/cli@0.8.0) (2018-04-16) diff --git a/packages/cli/package.json b/packages/cli/package.json index 5feeb77375fc..0c06aab60446 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/cli", - "version": "0.8.0", + "version": "0.9.0", "description": "Yeoman generator for LoopBack 4", "homepage": "https://github.com/strongloop/loopback-next/tree/master/packages/cli", "author": { @@ -24,8 +24,8 @@ "yeoman-generator" ], "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/node": "^8.10.4", "eslint-config-google": "^0.9.1", "glob": "^7.1.2", @@ -74,25 +74,26 @@ "nyc": "^11.7.1", "prettier": "^1.12.1", "rimraf": "^2.6.2", - "source-map-support": "^0.5.4", + "source-map-support": "^0.5.5", "strong-docs": "^1.10.2", "tslint": "^5.9.1", "typescript": "^2.8.1", - "@loopback/authentication": "^0.8.0", - "@loopback/boot": "^0.8.0", - "@loopback/build": "^0.5.0", - "@loopback/cli": "^0.8.0", - "@loopback/context": "^0.8.0", - "@loopback/core": "^0.6.0", - "@loopback/metadata": "^0.6.0", - "@loopback/openapi-spec-builder": "^0.5.0", - "@loopback/openapi-v3-types": "^0.4.0", - "@loopback/openapi-v3": "^0.7.0", - "@loopback/repository-json-schema": "^0.6.0", - "@loopback/repository": "^0.8.0", - "@loopback/rest": "^0.7.0", - "@loopback/testlab": "^0.7.0", - "@loopback/docs": "^0.5.0" + "@loopback/authentication": "^0.8.1", + "@loopback/boot": "^0.8.1", + "@loopback/build": "^0.6.0", + "@loopback/cli": "^0.9.0", + "@loopback/context": "^0.8.1", + "@loopback/core": "^0.6.1", + "@loopback/metadata": "^0.6.1", + "@loopback/openapi-spec-builder": "^0.5.1", + "@loopback/openapi-v3-types": "^0.5.0", + "@loopback/openapi-v3": "^0.8.0", + "@loopback/repository-json-schema": "^0.6.1", + "@loopback/repository": "^0.8.1", + "@loopback/rest": "^0.8.0", + "@loopback/testlab": "^0.8.0", + "@loopback/docs": "^0.5.1", + "glob": "^7.1.2" } }, "copyright.owner": "IBM Corp.", diff --git a/packages/context/CHANGELOG.md b/packages/context/CHANGELOG.md index 94aa4fdc20d2..e90723a57210 100644 --- a/packages/context/CHANGELOG.md +++ b/packages/context/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.8.1](https://github.com/strongloop/loopback-next/compare/@loopback/context@0.8.0...@loopback/context@0.8.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/context + # [0.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/context@0.7.0...@loopback/context@0.8.0) (2018-04-16) diff --git a/packages/context/package.json b/packages/context/package.json index a1307e5156c1..a231113e4bed 100644 --- a/packages/context/package.json +++ b/packages/context/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/context", - "version": "0.8.0", + "version": "0.8.1", "description": "LoopBack's container for Inversion of Control", "engines": { "node": ">=8" @@ -19,13 +19,13 @@ "copyright.owner": "IBM Corp.", "license": "MIT", "dependencies": { - "@loopback/metadata": "^0.6.0", + "@loopback/metadata": "^0.6.1", "debug": "^3.1.0", "uuid": "^3.2.1" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/bluebird": "^3.5.20", "@types/debug": "^0.0.30", "@types/node": "^8.10.4", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index c0680d0a23ea..3ae502e315ba 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.6.1](https://github.com/strongloop/loopback-next/compare/@loopback/core@0.6.0...@loopback/core@0.6.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/core + # [0.6.0](https://github.com/strongloop/loopback-next/compare/@loopback/core@0.5.2...@loopback/core@0.6.0) (2018-04-16) diff --git a/packages/core/package.json b/packages/core/package.json index 24b2887c7419..67606b72a119 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/core", - "version": "0.6.0", + "version": "0.6.1", "description": "", "engines": { "node": ">=8" @@ -20,11 +20,11 @@ "copyright.owner": "IBM Corp.", "license": "MIT", "dependencies": { - "@loopback/context": "^0.8.0" + "@loopback/context": "^0.8.1" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/node": "^8.10.4" }, "files": [ diff --git a/packages/metadata/CHANGELOG.md b/packages/metadata/CHANGELOG.md index b4301ce72e60..471f55635e16 100644 --- a/packages/metadata/CHANGELOG.md +++ b/packages/metadata/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.6.1](https://github.com/strongloop/loopback-next/compare/@loopback/metadata@0.6.0...@loopback/metadata@0.6.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/metadata + # [0.6.0](https://github.com/strongloop/loopback-next/compare/@loopback/metadata@0.5.0...@loopback/metadata@0.6.0) (2018-04-16) diff --git a/packages/metadata/package.json b/packages/metadata/package.json index 7c4a532ac96f..5c78a9016a6b 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/metadata", - "version": "0.6.0", + "version": "0.6.1", "description": "LoopBack's metadata utilities for reflection and decoration", "engines": { "node": ">=8" @@ -24,8 +24,8 @@ "reflect-metadata": "^0.1.10" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/debug": "^0.0.30", "@types/lodash": "^4.14.106", "@types/node": "^8.10.4" diff --git a/packages/openapi-spec-builder/CHANGELOG.md b/packages/openapi-spec-builder/CHANGELOG.md index 70614e5f49c5..c716e483b4f9 100644 --- a/packages/openapi-spec-builder/CHANGELOG.md +++ b/packages/openapi-spec-builder/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.5.1](https://github.com/strongloop/loopback-next/compare/@loopback/openapi-spec-builder@0.5.0...@loopback/openapi-spec-builder@0.5.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/openapi-spec-builder + # [0.5.0](https://github.com/strongloop/loopback-next/compare/@loopback/openapi-spec-builder@0.4.5...@loopback/openapi-spec-builder@0.5.0) (2018-04-16) diff --git a/packages/openapi-spec-builder/package.json b/packages/openapi-spec-builder/package.json index 9dd2925c0c28..7886a74eec3b 100644 --- a/packages/openapi-spec-builder/package.json +++ b/packages/openapi-spec-builder/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/openapi-spec-builder", - "version": "0.5.0", + "version": "0.5.1", "description": "Make it easy to create OpenAPI (Swagger) specification documents in your tests using the builder pattern.", "engines": { "node": ">=8" @@ -22,10 +22,10 @@ "Testing" ], "dependencies": { - "@loopback/openapi-v3-types": "^0.4.0" + "@loopback/openapi-v3-types": "^0.5.0" }, "devDependencies": { - "@loopback/build": "^0.5.0", + "@loopback/build": "^0.6.0", "@types/node": "^8.10.4" }, "files": [ diff --git a/packages/openapi-v3-types/CHANGELOG.md b/packages/openapi-v3-types/CHANGELOG.md index cae97397fa3a..9e41a62297bb 100644 --- a/packages/openapi-v3-types/CHANGELOG.md +++ b/packages/openapi-v3-types/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.5.0](https://github.com/strongloop/loopback-next/compare/@loopback/openapi-v3-types@0.4.0...@loopback/openapi-v3-types@0.5.0) (2018-04-25) + + +### Features + +* upgrade to openapi3-ts@0.11.0 ([1ed79c9](https://github.com/strongloop/loopback-next/commit/1ed79c9)) + + + + # [0.4.0](https://github.com/strongloop/loopback-next/compare/@loopback/openapi-v3-types@0.3.5...@loopback/openapi-v3-types@0.4.0) (2018-04-16) diff --git a/packages/openapi-v3-types/package.json b/packages/openapi-v3-types/package.json index 3b4b406b1265..05e93168344d 100644 --- a/packages/openapi-v3-types/package.json +++ b/packages/openapi-v3-types/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/openapi-v3-types", - "version": "0.4.0", + "version": "0.5.0", "description": "TypeScript type definitions for OpenAPI Specifications.", "engines": { "node": ">=8" @@ -9,8 +9,8 @@ "openapi3-ts": "^0.11.0" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/node": "^8.10.4" }, "scripts": { diff --git a/packages/openapi-v3/CHANGELOG.md b/packages/openapi-v3/CHANGELOG.md index 20d29d8359ae..ca44c675b138 100644 --- a/packages/openapi-v3/CHANGELOG.md +++ b/packages/openapi-v3/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/openapi-v3@0.7.0...@loopback/openapi-v3@0.8.0) (2018-04-25) + + +### Features + +* upgrade to openapi3-ts@0.11.0 ([1ed79c9](https://github.com/strongloop/loopback-next/commit/1ed79c9)) + + + + # [0.7.0](https://github.com/strongloop/loopback-next/compare/@loopback/openapi-v3@0.6.0...@loopback/openapi-v3@0.7.0) (2018-04-16) diff --git a/packages/openapi-v3/package.json b/packages/openapi-v3/package.json index 9f86e0a19f7e..ba8917a30369 100644 --- a/packages/openapi-v3/package.json +++ b/packages/openapi-v3/package.json @@ -1,15 +1,15 @@ { "name": "@loopback/openapi-v3", - "version": "0.7.0", + "version": "0.8.0", "description": "Processes openapi v3 related metadata", "engines": { "node": ">=8" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/openapi-spec-builder": "^0.5.0", - "@loopback/repository": "^0.8.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/openapi-spec-builder": "^0.5.1", + "@loopback/repository": "^0.8.1", + "@loopback/testlab": "^0.8.0", "@types/debug": "0.0.30", "@types/lodash": "^4.14.106", "@types/node": "^8.10.4" @@ -47,9 +47,9 @@ "url": "https://github.com/strongloop/loopback-next.git" }, "dependencies": { - "@loopback/context": "^0.8.0", - "@loopback/openapi-v3-types": "^0.4.0", - "@loopback/repository-json-schema": "^0.6.0", + "@loopback/context": "^0.8.1", + "@loopback/openapi-v3-types": "^0.5.0", + "@loopback/repository-json-schema": "^0.6.1", "debug": "^3.1.0", "lodash": "^4.17.5" } diff --git a/packages/repository-json-schema/CHANGELOG.md b/packages/repository-json-schema/CHANGELOG.md index 473b1115f0ec..2697548e9270 100644 --- a/packages/repository-json-schema/CHANGELOG.md +++ b/packages/repository-json-schema/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.6.1](https://github.com/strongloop/loopback-next/compare/@loopback/repository-json-schema@0.6.0...@loopback/repository-json-schema@0.6.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/repository-json-schema + # [0.6.0](https://github.com/strongloop/loopback-next/compare/@loopback/repository-json-schema@0.5.0...@loopback/repository-json-schema@0.6.0) (2018-04-16) diff --git a/packages/repository-json-schema/package.json b/packages/repository-json-schema/package.json index ba8b493ae039..b3086b2b3819 100644 --- a/packages/repository-json-schema/package.json +++ b/packages/repository-json-schema/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/repository-json-schema", - "version": "0.6.0", + "version": "0.6.1", "description": "Converts TS classes into JSON Schemas using TypeScript's reflection API", "engines": { "node": ">=8" @@ -24,14 +24,14 @@ "access": "public" }, "dependencies": { - "@loopback/context": "^0.8.0", - "@loopback/repository": "^0.8.0", + "@loopback/context": "^0.8.1", + "@loopback/repository": "^0.8.1", "lodash": "^4.17.5", "typescript-json-schema": "^0.22.0" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/lodash": "^4.14.106", "@types/node": "^8.10.4" }, diff --git a/packages/repository/CHANGELOG.md b/packages/repository/CHANGELOG.md index 4c21b394459e..1511427e38d1 100644 --- a/packages/repository/CHANGELOG.md +++ b/packages/repository/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.8.1](https://github.com/strongloop/loopback-next/compare/@loopback/repository@0.8.0...@loopback/repository@0.8.1) (2018-04-25) + + + + +**Note:** Version bump only for package @loopback/repository + # [0.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/repository@0.7.0...@loopback/repository@0.8.0) (2018-04-16) diff --git a/packages/repository/package.json b/packages/repository/package.json index 38b704052ac3..4af769aab00f 100644 --- a/packages/repository/package.json +++ b/packages/repository/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/repository", - "version": "0.8.0", + "version": "0.8.1", "description": "Repository based persistence for LoopBack 4", "engines": { "node": ">=8" @@ -20,13 +20,13 @@ "copyright.owner": "IBM Corp.", "license": "MIT", "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/testlab": "^0.8.0", "@types/node": "^8.10.4" }, "dependencies": { - "@loopback/context": "^0.8.0", - "@loopback/core": "^0.6.0", + "@loopback/context": "^0.8.1", + "@loopback/core": "^0.6.1", "loopback-datasource-juggler": "^3.16.0" }, "files": [ diff --git a/packages/rest/CHANGELOG.md b/packages/rest/CHANGELOG.md index b5303e0eee92..745faea9b9ee 100644 --- a/packages/rest/CHANGELOG.md +++ b/packages/rest/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/rest@0.7.0...@loopback/rest@0.8.0) (2018-04-25) + + +### Features + +* upgrade to openapi3-ts@0.11.0 ([1ed79c9](https://github.com/strongloop/loopback-next/commit/1ed79c9)) + + + + # [0.7.0](https://github.com/strongloop/loopback-next/compare/@loopback/rest@0.6.3...@loopback/rest@0.7.0) (2018-04-16) diff --git a/packages/rest/package.json b/packages/rest/package.json index d307cc7573e9..25295b57234b 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/rest", - "version": "0.7.0", + "version": "0.8.0", "description": "", "engines": { "node": ">=8" @@ -20,10 +20,10 @@ "copyright.owner": "IBM Corp.", "license": "MIT", "dependencies": { - "@loopback/context": "^0.8.0", - "@loopback/core": "^0.6.0", - "@loopback/openapi-v3": "^0.7.0", - "@loopback/openapi-v3-types": "^0.4.0", + "@loopback/context": "^0.8.1", + "@loopback/core": "^0.6.1", + "@loopback/openapi-v3": "^0.8.0", + "@loopback/openapi-v3-types": "^0.5.0", "@types/cors": "^2.8.3", "@types/http-errors": "^1.6.1", "body": "^5.1.0", @@ -35,10 +35,10 @@ "path-to-regexp": "^2.2.0" }, "devDependencies": { - "@loopback/build": "^0.5.0", - "@loopback/openapi-spec-builder": "^0.5.0", - "@loopback/repository": "^0.8.0", - "@loopback/testlab": "^0.7.0", + "@loopback/build": "^0.6.0", + "@loopback/openapi-spec-builder": "^0.5.1", + "@loopback/repository": "^0.8.1", + "@loopback/testlab": "^0.8.0", "@types/debug": "0.0.30", "@types/js-yaml": "^3.11.1", "@types/lodash": "^4.14.106", diff --git a/packages/testlab/CHANGELOG.md b/packages/testlab/CHANGELOG.md index 1825c926ab11..9b635075ac08 100644 --- a/packages/testlab/CHANGELOG.md +++ b/packages/testlab/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/testlab@0.7.0...@loopback/testlab@0.8.0) (2018-04-25) + + +### Bug Fixes + +* fix lint error from prettier 1.12.1 ([63c2f37](https://github.com/strongloop/loopback-next/commit/63c2f37)) + + +### Features + +* **build:** add an option to copy non ts files to outDir ([49b9a82](https://github.com/strongloop/loopback-next/commit/49b9a82)) + + + + # [0.7.0](https://github.com/strongloop/loopback-next/compare/@loopback/testlab@0.6.0...@loopback/testlab@0.7.0) (2018-04-16) diff --git a/packages/testlab/package.json b/packages/testlab/package.json index c1de1f9f2751..f49c16c81fc5 100644 --- a/packages/testlab/package.json +++ b/packages/testlab/package.json @@ -1,6 +1,6 @@ { "name": "@loopback/testlab", - "version": "0.7.0", + "version": "0.8.0", "description": "A collection of test utilities we use to write LoopBack tests.", "engines": { "node": ">=8" @@ -28,7 +28,7 @@ "swagger2openapi": "^2.11.16" }, "devDependencies": { - "@loopback/build": "^0.5.0", + "@loopback/build": "^0.6.0", "@types/node": "^8.10.4" }, "files": [