Skip to content

Commit

Permalink
Merge branch 'main' into v6
Browse files Browse the repository at this point in the history
  • Loading branch information
WikiRik committed Sep 27, 2022
2 parents ce19b3d + 497b805 commit 7f524a5
Show file tree
Hide file tree
Showing 23 changed files with 1,003 additions and 931 deletions.
2 changes: 1 addition & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $ sequelize init
```

## How can I generate a model?
Specify model name with `--name` argument. List of table fields can be passed with `--attributes` option
Specify model name with `--name` argument. List of table fields can be passed with `--attributes` option (comma separated with no spaces at all)
```
$ sequelize model:create --name User --attributes name:string,state:boolean,birth:date,card:integer,role:enum:'{Admin,Guest}'
```
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@
"lib"
],
"dependencies": {
"cli-color": "^2.0.1",
"cli-color": "^2.0.3",
"fs-extra": "^9.1.0",
"js-beautify": "^1.14.0",
"js-beautify": "^1.14.5",
"lodash": "^4.17.21",
"resolve": "^1.20.0",
"resolve": "^1.22.1",
"umzug": "^2.3.0",
"yargs": "^16.2.0"
},
"devDependencies": {
"@babel/cli": "7.17.10",
"@babel/core": "7.18.5",
"@babel/preset-env": "7.18.2",
"@babel/register": "7.17.7",
"@commitlint/cli": "17.0.2",
"@commitlint/config-angular": "17.0.0",
"@babel/cli": "7.18.10",
"@babel/core": "7.19.1",
"@babel/preset-env": "7.19.1",
"@babel/register": "7.18.9",
"@commitlint/cli": "17.1.2",
"@commitlint/config-angular": "17.1.0",
"bluebird": "3.7.2",
"eslint": "7.32.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-prettier": "4.2.1",
"expect.js": "0.3.1",
"gulp": "4.0.2",
"husky": "8.0.1",
"lint-staged": "13.0.2",
"lint-staged": "13.0.3",
"mocha": "9.2.2",
"mysql2": "latest",
"pg": "latest",
"pg-hstore": "latest",
"prettier": "2.7.1",
"semver": "7.3.7",
"sequelize": "6.21.0",
"sequelize": "6.23.1",
"sqlite3": "latest",
"through2": "4.0.2"
},
Expand Down
1 change: 1 addition & 0 deletions src/assets/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const fs = require('fs');
const path = require('path');
const Sequelize = require('sequelize');
const process = require('process');
const basename = path.basename(__filename);
const env = process.env.NODE_ENV || 'development';
const config = require(<%= configFile %>)[env];
Expand Down
1 change: 1 addition & 0 deletions src/commands/database.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions } from '../core/yargs';
import { logMigrator } from '../core/migrator';

Expand Down
1 change: 1 addition & 0 deletions src/commands/init.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions } from '../core/yargs';
import helpers from '../helpers';

Expand Down
1 change: 1 addition & 0 deletions src/commands/migrate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions } from '../core/yargs';
import {
getMigrator,
Expand Down
1 change: 1 addition & 0 deletions src/commands/migrate_undo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions } from '../core/yargs';
import { getMigrator, ensureCurrentMetaSchema } from '../core/migrator';

Expand Down
1 change: 1 addition & 0 deletions src/commands/migrate_undo_all.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions } from '../core/yargs';
import { getMigrator, ensureCurrentMetaSchema } from '../core/migrator';

Expand Down
1 change: 1 addition & 0 deletions src/commands/migration_generate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions, _underscoreOption } from '../core/yargs';

import helpers from '../helpers';
Expand Down
1 change: 1 addition & 0 deletions src/commands/model_generate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions, _underscoreOption } from '../core/yargs';

import helpers from '../helpers';
Expand Down
3 changes: 2 additions & 1 deletion src/commands/seed.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import _ from 'lodash';
import process from 'process';
import { _baseOptions } from '../core/yargs';
import { getMigrator } from '../core/migrator';

import helpers from '../helpers';
import _ from 'lodash';

exports.builder = (yargs) => _baseOptions(yargs).argv;
exports.handler = async function (args) {
Expand Down
1 change: 1 addition & 0 deletions src/commands/seed_generate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions } from '../core/yargs';

import helpers from '../helpers';
Expand Down
1 change: 1 addition & 0 deletions src/commands/seed_one.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'process';
import { _baseOptions } from '../core/yargs';
import { getMigrator } from '../core/migrator';

Expand Down
1 change: 1 addition & 0 deletions src/core/migrator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Umzug from 'umzug';
import _ from 'lodash';
import process from 'process';

import helpers from '../helpers/index';

Expand Down
1 change: 1 addition & 0 deletions src/core/yargs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'fs';
import yargs from 'yargs';
import path from 'path';
import process from 'process';

function loadRCFile(optionsPath) {
const rcFile = optionsPath || path.resolve(process.cwd(), '.sequelizerc');
Expand Down
1 change: 1 addition & 0 deletions src/helpers/config-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { promisify } from 'util';
import helpers from './index';
import getYArgs from '../core/yargs';
import importHelper from './import-helper';
import process from 'process';

const args = getYArgs().argv;

Expand Down
1 change: 1 addition & 0 deletions src/helpers/generic-helper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path';
import process from 'process';

const resolve = require('resolve').sync;
import getYArgs from '../core/yargs';
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/import-helper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const url = require('url');
import url from 'url';

async function supportsDynamicImport() {
try {
Expand Down
1 change: 1 addition & 0 deletions src/helpers/path-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import fs from 'fs';
import process from 'process';

const resolve = require('resolve').sync;
import getYArgs from '../core/yargs';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/umzug-helper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'path';
import _ from 'lodash';
import helpers from './index';
import process from 'process';

const storage = {
migration: 'sequelize',
Expand Down
1 change: 1 addition & 0 deletions src/helpers/version-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import helpers from './index';
import process from 'process';

const packageJson = require(path.resolve(
__dirname,
Expand Down
5 changes: 5 additions & 0 deletions src/helpers/view-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import clc from 'cli-color';
import _ from 'lodash';
import helpers from './index';
import getYArgs from '../core/yargs';
import process from 'process';

const args = getYArgs().argv;

Expand Down Expand Up @@ -36,6 +37,10 @@ module.exports = {

this.log();
console.error(`${clc.red('ERROR:')} ${message}`);
if (error.original.detail) {
console.error(`${clc.red('ERROR DETAIL:')} ${error.original.detail}`);
}

extraMessages.forEach((message) =>
console.error(`${clc.red('EXTRA MESSAGE:')} ${message}`)
);
Expand Down
Loading

0 comments on commit 7f524a5

Please sign in to comment.