Skip to content

Commit

Permalink
Update Dependencies (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueleite42 committed Feb 12, 2022
1 parent 27aacb4 commit 18597ae
Show file tree
Hide file tree
Showing 24 changed files with 765 additions and 577 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@
"peerDependencies": {
"@techmmunity/symbiosis": "^0.0.30",
"reflect-metadata": "^0.1.13",
"typescript": "^4.4.4"
"typescript": "^4.5.5"
},
"dependencies": {
"@techmmunity/utils": "^1.5.0",
"chalk": "^5.0.0",
"commander": "^8.3.0"
"commander": "^9.0.0"
},
"devDependencies": {
"@techmmunity/eslint-config": "^5.1.2",
"@techmmunity/eslint-config": "^5.2.2",
"@techmmunity/symbiosis": "^0.0.30",
"@types/jest": "^27.0.1",
"eslint": "^8.1.0",
"eslint": "^8.9.0",
"husky": "^7.0.4",
"jest": "^27.3.1",
"lint-staged": "^12.0.2",
"jest": "^27.5.1",
"lint-staged": "^12.3.3",
"prettier": "^2.3.2",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.7",
"ts-node": "^10.4.0",
"typescript": "^4.4.4"
"ts-jest": "^27.1.3",
"ts-node": "^10.5.0",
"typescript": "^4.5.5"
},
"scripts": {
"prepare": "husky install",
Expand All @@ -61,7 +61,7 @@
"build:ci": "tsc",
"format": "eslint . --fix --quiet",
"lint": "eslint . --quiet",
"upgrade-dependencies": "yarn upgrade-interactive --latest",
"upgrade:dependencies": "yarn upgrade-interactive --latest",
"husky:pre-commit": "tsc && lint-staged",
"lk": "yarn build && cp package.json dist/package.json && cd dist && yarn link && cd ..",
"ulk": "yarn unlink && yarn lk && chmod +x dist/cli/bin/index.js"
Expand Down
16 changes: 9 additions & 7 deletions src/cli/commands/gen-migration/gen-migration.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
/* eslint-disable @typescript-eslint/naming-convention */

import { loadEntities, Logger } from "@techmmunity/symbiosis";
import { cleanObj, getRootPath, isEmptyObject } from "@techmmunity/utils";
import { existsSync, writeFileSync } from "fs";

import { cleanObj, getRootPath, isEmptyObject } from "@techmmunity/utils";
import { loadEntities, Logger } from "@techmmunity/symbiosis";
import { getConfigFile } from "../../utils/get-config-file";
import { MigrationHandler } from "../../../lib/migration-handler";

import { getColType } from "./helpers/get-col-type";

import { getConfigFile } from "../../utils/get-config-file";
import { getMigrationsPath } from "../../utils/get-migrations-path";
import { Plugin } from "../types/plugin";
import { getTemplate } from "../../utils/get-template";
import { getSymbVersion } from "../../utils/get-symb-version";
import { getColType } from "./helpers/get-col-type";
import { MigrationHandler } from "../../../lib/migration-handler";
import { getTemplate } from "../../utils/get-template";

import type { Plugin } from "../types/plugin";

export const genMigrations = async () => {
const migrationsPath = getMigrationsPath();
Expand Down
5 changes: 3 additions & 2 deletions src/cli/commands/gen-migration/helpers/get-col-type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { MetadataUtil } from "@techmmunity/symbiosis";
import { ColumnMetadata } from "@techmmunity/symbiosis/lib/entity-manager/types/column-metadata";
import { ColumnType } from "../../../../lib/types/query-runner";

import type { ColumnType } from "../../../../lib/types/query-runner";
import type { ColumnMetadata } from "@techmmunity/symbiosis/lib/entity-manager/types/column-metadata";

export const getColType = (columnMetadata: ColumnMetadata): ColumnType => {
if (columnMetadata.databaseType) return columnMetadata.databaseType as any;
Expand Down
10 changes: 6 additions & 4 deletions src/cli/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { Logger } from "@techmmunity/symbiosis";
import { red } from "chalk";
import { Command } from "commander";
import chalk from "chalk";
import type { Command } from "commander";

import { genConfig } from "./gen-config";
import { genMigrations } from "./gen-migration/gen-migration";
import { createMigration } from "./migration-create";

const handleInvalidCommand = (program: Command) => {
program.on("command:*", () => {
Logger.cliError(`Invalid command: ${red("%s")}`);
Logger.cliError(`Invalid command: ${chalk.red("%s")}`);

Logger.cliLog(`See ${red("--help")} for a list of available commands.\n`);
Logger.cliLog(
`See ${chalk.red("--help")} for a list of available commands.\n`,
);

process.exit(1);
});
Expand Down
3 changes: 2 additions & 1 deletion src/cli/commands/migration-create.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { writeFileSync } from "fs";
import { getTemplate } from "../utils/get-template";

import { getMigrationsPath } from "../utils/get-migrations-path";
import { getSymbVersion } from "../utils/get-symb-version";
import { getTemplate } from "../utils/get-template";

interface Args {
description: string;
Expand Down
11 changes: 6 additions & 5 deletions src/cli/commands/run-migrations.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/* eslint-disable @typescript-eslint/naming-convention */

import { readdirSync } from "fs";
import { loadEntities, Logger } from "@techmmunity/symbiosis";
import { isEmptyArray, isPackageInstalled } from "@techmmunity/utils";
import { readdirSync } from "fs";

import { loadEntities, Logger } from "@techmmunity/symbiosis";
import { getConfigFile } from "../utils/get-config-file";
import type { BaseQueryRunner } from "../../lib/query-runner";

import { BaseQueryRunner } from "../../lib/query-runner";
import { getConfigFile } from "../utils/get-config-file";
import { getMigrationsPath } from "../utils/get-migrations-path";
import { Plugin } from "./types/plugin";

import type { Plugin } from "./types/plugin";

interface MigrationFile {
Migration: {
Expand Down
8 changes: 6 additions & 2 deletions src/cli/commands/types/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/* eslint-disable @typescript-eslint/naming-convention */

import { BaseConnectionOptions, BaseConnection } from "@techmmunity/symbiosis";
import { BaseQueryRunner, BaseSyncManager } from "../../..";
import type {
BaseConnectionOptions,
BaseConnection,
} from "@techmmunity/symbiosis";

import type { BaseQueryRunner, BaseSyncManager } from "../../..";

export interface Plugin {
Connection: {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/types/action.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Input } from "./input";
import type { Input } from "./input";

interface ActionParams {
inputs?: Array<Input>;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/types/command.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "commander";
import type { Command } from "commander";

interface CustomCommandParams {
action: (params?: any) => void;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/types/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseConnectionOptions } from "@techmmunity/symbiosis";
import type { BaseConnectionOptions } from "@techmmunity/symbiosis";

export interface ConfigFile<Opts = BaseConnectionOptions> {
plugin: string;
Expand Down
7 changes: 4 additions & 3 deletions src/cli/utils/get-config-file.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { existsSync } from "fs";
import { getRootPath, getTypeof } from "@techmmunity/utils";
import { Logger } from "@techmmunity/symbiosis";
import { ConfigFile } from "../types/config";
import { getRootPath, getTypeof } from "@techmmunity/utils";
import { existsSync } from "fs";

import type { ConfigFile } from "../types/config";

export const getConfigFile = () => {
const path = getRootPath("symbiosis.config.js");
Expand Down
4 changes: 2 additions & 2 deletions src/cli/utils/get-migrations-path.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync } from "fs";
import { Logger } from "@techmmunity/symbiosis";
import { getRootPath } from "@techmmunity/utils";
import { existsSync } from "fs";

import { Logger } from "@techmmunity/symbiosis";
import { getConfigFile } from "./get-config-file";

export const getMigrationsPath = () => {
Expand Down
1 change: 1 addition & 0 deletions src/cli/utils/get-template.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getRootPath } from "@techmmunity/utils";
import { readFileSync } from "fs";

import { localBinExists } from "./local-bin-exists";

export const getTemplate = (templateName: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/utils/local-binaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable @typescript-eslint/no-require-imports */

import { getRootPath } from "@techmmunity/utils";
import { Command } from "commander";
import type { Command } from "commander";

export const loadLocalBinCommandLoader = (program: Command) => {
const { loadCommands } = require(getRootPath(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/format.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Query } from "../types/migration-generator";
import type { Query } from "../types/migration-generator";

export const format = (queries: Array<Query>) => {
const query = queries
Expand Down
4 changes: 3 additions & 1 deletion src/lib/migration-handler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { cleanObj } from "@techmmunity/utils";

import { format } from "./helpers/format";

import type { Query } from "./types/migration-generator";
import {
import type {
CreateEntityParams,
CreateColumnParams,
CreateIndexParams,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/migration.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
Column,
Entity,
PrimaryColumn,
SaveDateColumn,
InsertDateColumn,
} from "@techmmunity/symbiosis";

@Entity("migrations")
Expand All @@ -19,6 +19,6 @@ export class MigrationEntity {
@Column()
public libVersion: string;

@SaveDateColumn()
@InsertDateColumn()
public createdAt: string;
}
2 changes: 1 addition & 1 deletion src/lib/migration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseQueryRunner } from "./query-runner";
import type { BaseQueryRunner } from "./query-runner";

export abstract class BaseMigration {
public abstract code: string;
Expand Down
6 changes: 4 additions & 2 deletions src/lib/sync-manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { BaseConnection, BaseRepository } from "@techmmunity/symbiosis";
import type { BaseConnection, BaseRepository } from "@techmmunity/symbiosis";

import { MigrationEntity } from "./migration.entity";
import { CreateMigrationRecordParams } from "./types/sync-manager";

import type { CreateMigrationRecordParams } from "./types/sync-manager";

export abstract class BaseSyncManager<Connection = any> {
public connection: Connection;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/migration-generator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
CreateColumnParams,
CreateEntityParams,
CreateEnumParams,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/sync-manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MigrationEntity } from "../migration.entity";
import type { MigrationEntity } from "../migration.entity";

export type CreateMigrationRecordParams = Omit<MigrationEntity, "createdAt">;

Expand Down
3 changes: 2 additions & 1 deletion src/tests/lib/helpers/format.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { format } from "../../../lib/helpers/format";
import { Query } from "../../../lib/types/migration-generator";

import type { Query } from "../../../lib/types/migration-generator";

describe("MigrationGenerator > format", () => {
const queries: Array<Query> = [
Expand Down
2 changes: 1 addition & 1 deletion src/types/typescript.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-var */
/* eslint-disable @typescript-eslint/naming-convention */

import ts from "typescript";
import type ts from "typescript";

declare global {
type TS = typeof ts;
Expand Down
Loading

0 comments on commit 18597ae

Please sign in to comment.