From cbf0f3c88ce01126408bb0a4872605e8c6540c9d Mon Sep 17 00:00:00 2001 From: Romain Lanz <2793951+RomainLanz@users.noreply.github.com> Date: Mon, 21 Dec 2020 05:37:24 +0100 Subject: [PATCH] feat: add option to sort migrations with naturalSort option * fix: add @adonisjs/ace as dev dependency * test(migrator): add naturalSort feature * feat(migrator): add naturalSort feature * test(migrator): remove 'only' flag * test(migrator): write back the db configuration before assertion * test(commands): use @adonisjs/core standalone build instead of @adonisjs/ace * ci: skip husky when installing npm deps * fix: make FileNode.filename optional * test(migrator): use path.sep to test path and remove batch assertion * test(migrator): verify that natural sort work for nested file --- Dockerfile | 10 +-- adonis-typings/database.ts | 2 + npm-audit.html | 109 +++++++++++++++++++++++++-- src/Migrator/MigrationSource.ts | 9 ++- src/utils/index.ts | 3 +- test/commands/db-seed.spec.ts | 2 +- test/commands/make-migration.spec.ts | 2 +- test/commands/make-model.spec.ts | 2 +- test/commands/migrate.spec.ts | 2 +- test/migrations/migrator.spec.ts | 106 +++++++++++++++++++++++++- 10 files changed, 230 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe8c7367..985bdbe7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ FROM node:12.0.0-alpine as build-deps RUN apk update && apk upgrade && \ - apk add --update git && \ - apk add --update openssh && \ - apk add --update bash && \ - apk add --update wget + apk add --update git && \ + apk add --update openssh && \ + apk add --update bash && \ + apk add --update wget WORKDIR /usr/src/app COPY package*.json ./ -RUN npm install +RUN HUSKY_SKIP_INSTALL=1 npm install COPY . . RUN npm run build diff --git a/adonis-typings/database.ts b/adonis-typings/database.ts index b5ecf356..2f129cd2 100644 --- a/adonis-typings/database.ts +++ b/adonis-typings/database.ts @@ -36,6 +36,7 @@ declare module '@ioc:Adonis/Lucid/Database' { * implementation */ export type FileNode = { + filename?: string absPath: string name: string getSource: () => T @@ -274,6 +275,7 @@ declare module '@ioc:Adonis/Lucid/Database' { paths?: string[] tableName?: string disableRollbacksInProduction?: boolean + naturalSort?: boolean } /** diff --git a/npm-audit.html b/npm-audit.html index e5aed29c..671ed137 100644 --- a/npm-audit.html +++ b/npm-audit.html @@ -15,7 +15,7 @@ href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.3.1/build/styles/atom-one-dark.min.css"> NPM Audit Report - +