Skip to content

Commit

Permalink
Removed neu folder (airtasker#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfportal authored Jan 22, 2020
1 parent 88144e8 commit bd8cf77
Show file tree
Hide file tree
Showing 216 changed files with 58 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: yarn build
- run: ./bin/run validate ./lib/src/neu/validation-server/spots/api.ts
- run: ./bin/run validate ./lib/src/validation-server/spots/api.ts

publish:
<<: *job_configuration
Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/checksum.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Command, flags } from "@oclif/command";
import { hashContract } from "../../../lib/src/neu/checksum/hash";
import { parse } from "../../../lib/src/neu/parser";
import { hashContract } from "../../../lib/src/checksum/hash";
import { parse } from "../../../lib/src/parser";

const ARG_API = "spot_contract";

Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/docs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Command, flags } from "@oclif/command";
import express from "express";
import path from "path";
import { generateOpenAPI3 } from "../../../lib/src/neu/generators/openapi3/openapi3";
import { parse } from "../../../lib/src/neu/parser";
import { generateOpenAPI3 } from "../../../lib/src/generators/openapi3/openapi3";
import { parse } from "../../../lib/src/parser";

const ARG_API = "spot_contract";

Expand Down
10 changes: 5 additions & 5 deletions cli/src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { prompt } from "inquirer";
import YAML from "js-yaml";
import sortBy from "lodash/sortBy";
import path from "path";
import { Contract } from "../../../lib/src/definitions";
import { generateJsonSchema } from "../../../lib/src/generators/json-schema/json-schema";
import { generateOpenAPI2 } from "../../../lib/src/generators/openapi2/openapi2";
import { generateOpenAPI3 } from "../../../lib/src/generators/openapi3/openapi3";
import { outputFile } from "../../../lib/src/io/output";
import { Contract } from "../../../lib/src/neu/definitions";
import { generateJsonSchema } from "../../../lib/src/neu/generators/json-schema/json-schema";
import { generateOpenAPI2 } from "../../../lib/src/neu/generators/openapi2/openapi2";
import { generateOpenAPI3 } from "../../../lib/src/neu/generators/openapi3/openapi3";
import { parse } from "../../../lib/src/neu/parser";
import { parse } from "../../../lib/src/parser";

export default class Generate extends Command {
static description =
Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/lint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Command, flags } from "@oclif/command";
import { lint } from "../../../lib/src/neu/linting/linter";
import { parse } from "../../../lib/src/neu/parser";
import { lint } from "../../../lib/src/linting/linter";
import { parse } from "../../../lib/src/parser";

const ARG_API = "spot_contract";

Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/mock.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Command, flags } from "@oclif/command";
import { runMockServer } from "../../../lib/src/neu/mock-server/server";
import { parse } from "../../../lib/src/neu/parser";
import { runMockServer } from "../../../lib/src/mock-server/server";
import { parse } from "../../../lib/src/parser";
import inferProxyConfig from "../common/infer-proxy-config";

const ARG_API = "spot_contract";
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/validate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Command, flags } from "@oclif/command";
import { parse } from "../../../lib/src/neu/parser";
import { parse } from "../../../lib/src/parser";

const ARG_API = "spot_contract";

Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/validation-server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Command, flags } from "@oclif/command";
import { parse } from "../../../lib/src/neu/parser";
import { runValidationServer } from "../../../lib/src/neu/validation-server/server";
import { parse } from "../../../lib/src/parser";
import { runValidationServer } from "../../../lib/src/validation-server/server";

const ARG_API = "spot_contract";

Expand Down
2 changes: 1 addition & 1 deletion cli/src/common/infer-proxy-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProxyConfig } from "../../../lib/src/neu/mock-server/server";
import { ProxyConfig } from "../../../lib/src/mock-server/server";

export default function inferProxyConfig(
proxyBaseUrl: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { Endpoint } from "../definitions";
import { parseContract } from "../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind } from "../types";
import { hashContract } from "./hash";

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isJSONSchemaDraft7, Spectral } from "@stoplight/spectral";
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { generateJsonSchema } from "./json-schema";

describe("JSON Schema generator", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isOpenApiv2, Spectral } from "@stoplight/spectral";
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { Contract } from "../../definitions";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { generateOpenAPI2 } from "./openapi2";

describe("OpenAPI 2 generator", () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isOpenApiv3, Spectral } from "@stoplight/spectral";
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { Contract } from "../../definitions";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { generateOpenAPI3 } from "./openapi3";

describe("OpenAPI 3 generator", () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { hasDiscriminator } from "./has-discriminator";

describe("has-discriminator linter rule", () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { hasQueryParameters } from "./has-query-parameters";

describe("has-request-payload linter rule", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { hasRequestPayload } from "./has-request-payload";

describe("has-request-payload linter rule", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { hasResponsePayload } from "./has-response-payload";

describe("has-response-payload linter rule", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { hasResponse } from "./has-response";

describe("has-response linter rule", () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { noInlineObjectsWithinUnions } from "./no-inline-objects-within-unions";

describe("no-inline-objects-within-unions linter rule", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { noNullableArrays } from "./no-nullable-arrays";

describe("no-nullable-arrays linter rule", () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { noNullableFieldsWithinRequestBodies } from "./no-nullable-fields-within-request-bodies";

describe("no-nullable-fields-within-request-bodies linter rule", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { noOmittableFieldsWithinResponseBodies } from "./no-omittable-fields-within-response-bodies";

describe("no-omittable-fields-within-response-bodies linter rule", () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cors from "cors";
import express from "express";
import { Logger } from "../../utilities/logger";
import { Contract } from "../definitions";
import { TypeTable } from "../types";
import { Logger } from "../utilities/logger";
import { generateData } from "./dummy";
import { isRequestForEndpoint } from "./matcher";
import { proxyRequest } from "./proxy";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { OptionalNotAllowedError } from "../errors";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseBody } from "./body-parser";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { parseConfig } from "./config-parser";

describe("config parser", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ClassDeclaration } from "ts-morph";
import { ConfigConfig } from "../../syntax";
import { Config } from "../definitions";
import { ParserError } from "../errors";
import { ConfigConfig } from "../syntax";
import { ok, Result } from "../util";
import {
getDecoratorConfigOrThrow,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { ParserError } from "../errors";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { parseContract } from "./contract-parser";

describe("contract parser", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ClassDeclaration, SourceFile } from "ts-morph";
import { ApiConfig } from "../../syntax/api";
import { Config, Contract, Endpoint } from "../definitions";
import { ParserError } from "../errors";
import { LociTable } from "../locations";
import { ApiConfig } from "../syntax/api";
import { TypeTable } from "../types";
import { err, ok, Result } from "../util";
import { defaultConfig, parseConfig } from "./config-parser";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseDefaultResponse } from "./default-response-parser";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { ParserError } from "../errors";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseEndpoint } from "./endpoint-parser";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
ObjectLiteralExpression,
TypeGuards
} from "ts-morph";
import { EndpointConfig } from "../../syntax/endpoint";
import { Endpoint, Response } from "../definitions";
import { ParserError } from "../errors";
import { LociTable } from "../locations";
import { EndpointConfig } from "../syntax/endpoint";
import { TypeTable } from "../types";
import { err, ok, Result } from "../util";
import { parseDefaultResponse } from "./default-response-parser";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { OptionalNotAllowedError, ParserError } from "../errors";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseHeaders } from "./headers-parser";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import {
getDecoratorConfigOrThrow,
getSelfAndLocalDependencies
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { OptionalNotAllowedError, ParserError } from "../errors";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parsePathParams } from "./path-params-parser";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { OptionalNotAllowedError, ParserError } from "../errors";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseQueryParams } from "./query-params-parser";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseRequest } from "./request-parser";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseResponse } from "./response-parser";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { MethodDeclaration } from "ts-morph";
import { ResponseConfig } from "../../syntax/response";
import { Response } from "../definitions";
import { ParserError } from "../errors";
import { LociTable } from "../locations";
import { ResponseConfig } from "../syntax/response";
import { TypeTable } from "../types";
import { ok, Result } from "../util";
import { parseBody } from "./body-parser";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { OptionalNotAllowedError, ParserError } from "../errors";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseSecurityHeader } from "./security-header-parser";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { TypeNotAllowedError } from "../errors";
import { LociTable } from "../locations";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import { TypeKind, TypeTable } from "../types";
import { parseType } from "./type-parser";

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/src/syntax/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryParamArrayStrategy } from "../neu/definitions";
import { QueryParamArrayStrategy } from "../definitions";

/**
* Class decorator factory for describing a configuration.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/syntax/endpoint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpMethod } from "../neu/definitions";
import { HttpMethod } from "../definitions";

/**
* Endpoint decorator factory for describing an API.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import request from "supertest";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import { parseContract } from "../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../spec-helpers/helper";
import {
recordedRequestToUserInputRequest,
recordedResponseToUserInputResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import express from "express";
import { Logger } from "../../utilities/logger";
import { Contract } from "../definitions";
import { Logger } from "../utilities/logger";
import { InternalServerError } from "./spots/utils";
import {
RecordedRequest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { api } from "../../../lib";
import { api } from "../../lib";

import "./health";
import "./validate";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { endpoint, request, response } from "../../../lib";
import { endpoint, request, response } from "../../lib";

@endpoint({
method: "GET",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { String } from "../../../lib";
import { String } from "../../lib";

export interface BaseError {
error_code: String;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import {
body,
endpoint,
Integer,
request,
response,
String
} from "../../../lib";
import { HttpMethod } from "../../definitions";
import { body, endpoint, Integer, request, response, String } from "../../lib";
import { Header, InternalServerError, UnprocessableEntityError } from "./utils";

@endpoint({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createProjectFromExistingSourceFile } from "../../../spec-helpers/helper";
import { parseContract } from "../../parsers/contract-parser";
import { createProjectFromExistingSourceFile } from "../../spec-helpers/helper";
import {
ContractMismatcher,
pathMatchesVariablePath
Expand Down

0 comments on commit bd8cf77

Please sign in to comment.