gina-sequelize 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ {
2
+ "cSpell.words": [
3
+ "nocheck"
4
+ ]
5
+ }
package/bin/index.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  #!/usr/bin/env ts-node
2
2
 
3
- import yargs from 'yargs/yargs';
4
- import { hideBin } from 'yargs/helpers';
5
- import { readdir, mkdir, writeFile } from 'fs/promises';
6
- import moment from 'moment';
3
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4
+ // @ts-nocheck
5
+
6
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
7
+ const yargs = require('yargs/yargs');
8
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
9
+ const { hideBin } = require('yargs/helpers');
10
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
11
+ const { readdir, mkdir, writeFile } = require('fs/promises');
12
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
13
+ const moment = require('moment');
7
14
 
8
15
  async function createInitialFolder() {
9
16
  const files = await readdir('.');
@@ -106,7 +113,7 @@ export { initializeModels };
106
113
 
107
114
  }
108
115
 
109
- async function generateMigration(migrationName: string) {
116
+ async function generateMigration(migrationName) {
110
117
  try {
111
118
  const pathName = process.cwd();
112
119
  const initFile = await import(pathName + '/gina/initializeModels.ts');
@@ -143,7 +150,7 @@ async function upgrade() {
143
150
  const files = (await readdir(pathName + '/gina/migrations')).filter(file => !file.includes('.d.ts') && !file.includes('.js.map'));
144
151
 
145
152
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
146
- const migrations: { [file: string]: any; } = {};
153
+ const migrations = {};
147
154
 
148
155
  for (const file of files) {
149
156
  const filePath = await import(pathName + '/gina/migrations/' + file);
@@ -177,7 +184,7 @@ yargs(hideBin(process.argv))
177
184
  describe: 'Name of the migration to be added'
178
185
  });
179
186
  }, (argv) => {
180
- generateMigration(argv['migration-name'] as string);
187
+ generateMigration(argv['migration-name']);
181
188
  })
182
189
  .command('upgrade', 'upgrade database to its last revision', () => {
183
190
  upgrade();
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "gina-cli": "./bin/index.ts"
6
6
  },
7
7
  "types": "./dist/gina.d.ts",
8
- "version": "0.0.10",
8
+ "version": "0.0.11",
9
9
  "description": "Gina is a tool to auto-generate and run migrations based on Sequelize ORM.",
10
10
  "scripts": {
11
11
  "eslint": "eslint .",