Giter Site home page Giter Site logo

Comments (7)

mmkal avatar mmkal commented on May 26, 2024

The external typings should not be used with v3. Just remove the dependency.

from umzug.

redevill avatar redevill commented on May 26, 2024

Just tried what you suggested:
This is the code import statement and below are the compilation errors.

import { Migration, Umzug, UpDownMigrationsOptions } from 'umzug';


Building Node Server
server/db/dbMgmt/ormFactory.ts:3:10 - error TS2724: '"umzug"' has no exported member named 'Migration'. Did you mean 'MigrationFn'?

3 import { Migration, Umzug, UpDownMigrationsOptions } from 'umzug';
~~~~~~~~~

server/db/dbMgmt/ormFactory.ts:3:28 - error TS2305: Module '"umzug"' has no exported member 'UpDownMigrationsOptions'.

3 import { Migration, Umzug, UpDownMigrationsOptions } from 'umzug';
~~~~~~~~~~~~~~~~~~~~~~~

server/services/db-admin.handlers.ts:5:10 - error TS2305: Module '"umzug"' has no exported member 'UpDownMigrationsOptions'.

5 import { UpDownMigrationsOptions } from 'umzug';
~~~~~~~~~~~~~~~~~~~~~~~

from umzug.

redevill avatar redevill commented on May 26, 2024

FYI - did use the npm ci option to ensure a rebuild of the node modules. Also tried several other V3 tags - V3.2.1 , V3.0.0 and the first beta... all give the same errors.

from umzug.

mmkal avatar mmkal commented on May 26, 2024

See the error: Module '"umzug"' has no exported member 'UpDownMigrationsOptions'.. This is not an export of v3. I believe it also wasn't an official export of v2 - the types were originally maintained separately - so it's not documented in the migration guide. But, have a look at the readme to make sure you understand the differences between 2 and 3. If you'd like to add a note to the readme a PR would be welcome.

from umzug.

redevill avatar redevill commented on May 26, 2024

Not sure I understand - A primary public function in umzug V2 & V3 - is the method "up" as defined below:
up(options?: UpToOptions | UpDownMigrationsOptions): Promise<Migration[]>;

How am I to create a strongly typed options object "UpDownMigrationsOptions" to pass to the publicly defined method "up" if it is not exported?

Or is the intent of the library to remove the ability to supply options to the "up" method?

from umzug.

mmkal avatar mmkal commented on May 26, 2024

(Edited - sorry, I originally submitted partial message)

A primary public function in umzug V2 & V3 - is the method "up" as defined below:
up(options?: UpToOptions | UpDownMigrationsOptions): Promise<Migration[]>;

No it isn't:

async up(options: MigrateUpOptions = {}): Promise<MigrationMeta[]> {

Unless I'm misunderstanding you? Where in V3 did you find that code?

from umzug.

redevill avatar redevill commented on May 26, 2024

Apologies - in the upgrade process, the old typings were not removed - causing my confusion.

from umzug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.