Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Chore: Update package name from @vulcan to @vulcan-sql #20

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@


# Vulcan
# Vulcan SQL

This project was generated using [Nx](https://nx.dev).

Expand Down Expand Up @@ -45,7 +43,7 @@ Run `nx g @nrwl/react:lib my-lib` to generate a library.

> You can also use any of the plugins above to generate libraries as well.

Libraries are shareable across libraries and applications. They can be imported from `@vulcan/mylib`.
Libraries are shareable across libraries and applications. They can be imported from `@vulcan-sql/mylib`.

## Development server

Expand Down Expand Up @@ -79,8 +77,6 @@ Run `nx graph` to see a diagram of the dependencies of your projects.

Visit the [Nx Documentation](https://nx.dev) to learn more.



## ☁ Nx Cloud

### Distributed Computation Caching & Distributed Task Execution
Expand Down
9 changes: 2 additions & 7 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "nx/presets/core.json",
"npmScope": "vulcan",
"npmScope": "vulcan-sql",
"affected": {
"defaultBase": "main"
},
Expand All @@ -11,12 +11,7 @@
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"lint",
"test",
"e2e"
]
"cacheableOperations": ["build", "lint", "test", "e2e"]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vulcan",
"name": "vulcan-sql",
"version": "0.0.0",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@vulcan/build",
"name": "@vulcan-sql/build",
"version": "0.0.1",
"type": "commonjs"
}
4 changes: 2 additions & 2 deletions packages/build/src/containers/container.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Container as InversifyContainer } from 'inversify';
import { Container as CoreContainer } from '@vulcan/core';
import { IBuildOptions } from '@vulcan/build/models';
import { Container as CoreContainer } from '@vulcan-sql/core';
import { IBuildOptions } from '@vulcan-sql/build/models';
import { schemaParserModule } from './modules';

export class Container {
Expand Down
7 changes: 5 additions & 2 deletions packages/build/src/containers/modules/schemaParser.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { ISchemaParserOptions, SchemaReaderType } from '@vulcan/build/models';
import {
ISchemaParserOptions,
SchemaReaderType,
} from '@vulcan-sql/build/models';
import {
FileSchemaReader,
SchemaParser,
SchemaReader,
} from '@vulcan/build/schema-parser';
} from '@vulcan-sql/build/schema-parser';
import { ContainerModule, interfaces } from 'inversify';
import { SchemaParserOptions } from '../../options/schemaParser';
import { TYPES } from '../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AllTemplateMetadata, APISchema } from '@vulcan/core';
import { AllTemplateMetadata, APISchema } from '@vulcan-sql/core';
import { SchemaParserMiddleware } from './middleware';

interface ErrorCode {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FieldInType } from '@vulcan/core';
import { FieldInType } from '@vulcan-sql/core';
import { SchemaParserMiddleware } from './middleware';

// Add the "required" validator when the parameters are in path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AllTemplateMetadata, APISchema } from '@vulcan/core';
import { AllTemplateMetadata, APISchema } from '@vulcan-sql/core';
import { SchemaParserMiddleware } from './middleware';

interface Parameter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SchemaParserMiddleware } from './middleware';
import { chain } from 'lodash';
import { APISchema, IValidatorLoader } from '@vulcan/core';
import { APISchema, IValidatorLoader } from '@vulcan-sql/core';

export const checkValidator =
(loader: IValidatorLoader): SchemaParserMiddleware =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FieldDataType } from '@vulcan/core';
import { FieldDataType } from '@vulcan-sql/core';
import { DeepPartial } from 'ts-essentials';
import { RawResponseProperty, SchemaParserMiddleware } from './middleware';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FieldDataType, FieldInType } from '@vulcan/core';
import { FieldDataType, FieldInType } from '@vulcan-sql/core';
import { SchemaParserMiddleware } from './middleware';

// /user/{id} => {request: [{fieldName: 'id', fieldIn: 'path' ....}]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
RequestSchema as RequestParameter,
ResponseProperty,
ValidatorDefinition,
} from '@vulcan/core';
} from '@vulcan-sql/core';
import { DeepPartial } from 'ts-essentials';

export interface RawRequestParameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FieldDataType } from '@vulcan/core';
import { FieldDataType } from '@vulcan-sql/core';
import { DeepPartial } from 'ts-essentials';
import { RawResponseProperty, SchemaParserMiddleware } from './middleware';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FieldInType } from '@vulcan/core';
import { FieldInType } from '@vulcan-sql/core';
import { SchemaParserMiddleware } from './middleware';

// FieldIn: query => FieldIn FieldInType.QUERY
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APISchema, IValidatorLoader } from '@vulcan/core';
import { APISchema, IValidatorLoader } from '@vulcan-sql/core';
import { chain } from 'lodash';
import { SchemaParserMiddleware } from './middleware';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import * as glob from 'glob';
import { promises as fs } from 'fs';
import * as path from 'path';
import { inject, injectable } from 'inversify';
import { TYPES } from '@vulcan/build/containers';
import { SchemaParserOptions } from '@vulcan/build/options';
import { TYPES } from '@vulcan-sql/build/containers';
import { SchemaParserOptions } from '@vulcan-sql/build/options';

export interface FileSchemaReaderOptions {
folderPath: string;
Expand Down
6 changes: 3 additions & 3 deletions packages/build/src/lib/schema-parser/schemaParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
TemplateMetadata,
TYPES as CORE_TYPES,
IValidatorLoader,
} from '@vulcan/core';
} from '@vulcan-sql/core';
import { SchemaData, SchemaFormat, SchemaReader } from './schema-reader';
import * as yaml from 'js-yaml';
import {
Expand All @@ -25,8 +25,8 @@ import {
} from './middleware';
import * as compose from 'koa-compose';
import { inject, injectable, interfaces } from 'inversify';
import { TYPES } from '@vulcan/build/containers';
import { SchemaParserOptions } from '@vulcan/build/options';
import { TYPES } from '@vulcan-sql/build/containers';
import { SchemaParserOptions } from '@vulcan-sql/build/options';

export interface SchemaParseResult {
schemas: APISchema[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
RequestSchema as RequestParameter,
RequiredConstraint,
ResponseProperty,
} from '@vulcan/core';
} from '@vulcan-sql/core';
import { isEmpty } from 'lodash';

export class OAS3SpecGenerator extends SpecGenerator<oas3.OpenAPIObject> {
Expand Down
2 changes: 1 addition & 1 deletion packages/build/src/lib/spec-generator/specGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APISchema } from '@vulcan/core';
import { APISchema } from '@vulcan-sql/core';
import { IBuildOptions } from '../../models/buildOptions';

export abstract class SpecGenerator<T> {
Expand Down
8 changes: 4 additions & 4 deletions packages/build/src/lib/vulcanBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { IBuildOptions } from '@vulcan/build/models';
import { Container, TYPES } from '@vulcan/build/containers';
import { SchemaParser } from '@vulcan/build/schema-parser';
import { IBuildOptions } from '@vulcan-sql/build/models';
import { Container, TYPES } from '@vulcan-sql/build/containers';
import { SchemaParser } from '@vulcan-sql/build/schema-parser';
import {
TemplateEngine,
TYPES as CORE_TYPES,
VulcanArtifactBuilder,
} from '@vulcan/core';
} from '@vulcan-sql/core';

export class VulcanBuilder {
public async build(options: IBuildOptions) {
Expand Down
2 changes: 1 addition & 1 deletion packages/build/src/models/buildOptions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ICoreOptions } from '@vulcan/core';
import { ICoreOptions } from '@vulcan-sql/core';
import { ISchemaParserOptions } from './schemaParserOptions';

export interface IBuildOptions extends ICoreOptions {
Expand Down
7 changes: 5 additions & 2 deletions packages/build/src/options/schemaParser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { injectable, inject, optional } from 'inversify';
import { TYPES } from '@vulcan/build/containers';
import { ISchemaParserOptions, SchemaReaderType } from '@vulcan/build/models';
import { TYPES } from '@vulcan-sql/build/containers';
import {
ISchemaParserOptions,
SchemaReaderType,
} from '@vulcan-sql/build/models';
import { IsOptional, IsString, validateSync } from 'class-validator';

@injectable()
Expand Down
4 changes: 2 additions & 2 deletions packages/build/test/builder/builder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { VulcanBuilder } from '../../src';
import * as path from 'path';
import { IBuildOptions, SchemaReaderType } from '@vulcan/build/models';
import { IBuildOptions, SchemaReaderType } from '@vulcan-sql/build/models';
import {
PersistentStoreType,
SerializerType,
TemplateProviderType,
} from '@vulcan/core';
} from '@vulcan-sql/core';

it('Builder.build should work', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RawAPISchema } from '../../../src';
import { addMissingErrors } from '../../../src/lib/schema-parser/middleware/addMissingErrors';
import { AllTemplateMetadata } from '@vulcan/core';
import { AllTemplateMetadata } from '@vulcan-sql/core';

it('Should add missing error codes', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { addRequiredValidatorForPath } from '@vulcan/build/schema-parser/middleware';
import { APISchema, FieldInType } from '@vulcan/core';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { addRequiredValidatorForPath } from '@vulcan-sql/build/schema-parser/middleware';
import { APISchema, FieldInType } from '@vulcan-sql/core';

it('Should add required validator for parameter in path', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RawAPISchema } from '../../../src';
import { checkParameter } from '../../../src/lib/schema-parser/middleware/checkParameter';
import { AllTemplateMetadata } from '@vulcan/core';
import { AllTemplateMetadata } from '@vulcan-sql/core';

it('Should pass when every parameter has been defined', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { checkValidator } from '@vulcan/build/schema-parser/middleware/checkValidator';
import { IValidatorLoader } from '@vulcan/core';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { checkValidator } from '@vulcan-sql/build/schema-parser/middleware/checkValidator';
import { IValidatorLoader } from '@vulcan-sql/core';
import * as sinon from 'ts-sinon';

it('Should pass if there is no error', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { generateDataType } from '@vulcan/build/schema-parser/middleware';
import { FieldDataType } from '@vulcan/core';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { generateDataType } from '@vulcan-sql/build/schema-parser/middleware';
import { FieldDataType } from '@vulcan-sql/core';

it('Should generate data type (string) for requests when it was not defined', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { generatePathParameters } from '@vulcan/build/schema-parser/middleware';
import { FieldDataType, FieldInType } from '@vulcan/core';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { generatePathParameters } from '@vulcan-sql/build/schema-parser/middleware';
import { FieldDataType, FieldInType } from '@vulcan-sql/core';

it('Should generate path parameters when they were not defined', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { generateTemplateSource } from '@vulcan/build/schema-parser/middleware/generateTemplateSource';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { generateTemplateSource } from '@vulcan-sql/build/schema-parser/middleware/generateTemplateSource';

it('Should keep templateSource in schema', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { generateUrl } from '@vulcan/build/schema-parser/middleware/generateUrl';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { generateUrl } from '@vulcan-sql/build/schema-parser/middleware/generateUrl';

it('Should keep url in schema', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { normalizeDataType } from '@vulcan/build/schema-parser/middleware';
import { FieldDataType } from '@vulcan/core';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { normalizeDataType } from '@vulcan-sql/build/schema-parser/middleware';
import { FieldDataType } from '@vulcan-sql/core';

it('Should normalize data type for requests', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { normalizeFieldIn } from '@vulcan/build/schema-parser/middleware';
import { FieldInType } from '@vulcan/core';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { normalizeFieldIn } from '@vulcan-sql/build/schema-parser/middleware';
import { FieldInType } from '@vulcan-sql/core';

it('Should normalize in field', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { setConstraints } from '@vulcan/build/schema-parser/middleware';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { setConstraints } from '@vulcan-sql/build/schema-parser/middleware';
import {
Constraint,
MinValueConstraint,
RequiredConstraint,
IValidatorLoader,
} from '@vulcan/core';
} from '@vulcan-sql/core';
import * as sinon from 'ts-sinon';

it('Should set and compose constraints', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RawAPISchema } from '@vulcan/build/schema-parser';
import { transformValidator } from '@vulcan/build/schema-parser/middleware/transformValidator';
import { RawAPISchema } from '@vulcan-sql/build/schema-parser';
import { transformValidator } from '@vulcan-sql/build/schema-parser/middleware/transformValidator';

it('Should convert string validator to proper format', async () => {
// Arrange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { FileSchemaReader, SchemaData } from '@vulcan/build/schema-parser';
import { FileSchemaReader, SchemaData } from '@vulcan-sql/build/schema-parser';
import * as path from 'path';
import { Container } from 'inversify';
import { TYPES } from '@vulcan/build/containers';
import { SchemaParserOptions } from '@vulcan/build/options';
import { ISchemaParserOptions, SchemaReaderType } from '@vulcan/build/models';
import { TYPES } from '@vulcan-sql/build/containers';
import { SchemaParserOptions } from '@vulcan-sql/build/options';
import {
ISchemaParserOptions,
SchemaReaderType,
} from '@vulcan-sql/build/models';

let container: Container;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { FileSchemaReader } from '@vulcan/build/schema-parser';
import { FileSchemaReader } from '@vulcan-sql/build/schema-parser';
import * as path from 'path';
import { SchemaParserOptions } from '@vulcan/build/options';
import { TYPES } from '@vulcan/build/containers';
import { ISchemaParserOptions, SchemaReaderType } from '@vulcan/build/models';
import { SchemaParserOptions } from '@vulcan-sql/build/options';
import { TYPES } from '@vulcan-sql/build/containers';
import {
ISchemaParserOptions,
SchemaReaderType,
} from '@vulcan-sql/build/models';
import { Container } from 'inversify';

let container: Container;
Expand Down
Loading