From 263db65cabe7a29c71214892b89c6b94d5a15647 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Sat, 8 Jun 2019 14:57:53 +0200 Subject: [PATCH 01/21] add changelog Signed-off-by: Tobias Gurtzick --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f52e214c..4d71581e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +## [0.11.6](https://github.com/db-migrate/node-db-migrate/compare/v0.11.5...v0.11.6) (2019-06-08) + + +### Bug Fixes + +* **cwd:** addition of cwd missed function definition ([fae85cf](https://github.com/db-migrate/node-db-migrate/commit/fae85cf)) +* **plugin:** allow no package.json ([f27dce0](https://github.com/db-migrate/node-db-migrate/commit/f27dce0)) +* **plugin:** handle non existent dependencies and improve UX ([006ef5e](https://github.com/db-migrate/node-db-migrate/commit/006ef5e)), closes [#628](https://github.com/db-migrate/node-db-migrate/issues/628) +* **plugin:** respect options cwd ([#618](https://github.com/db-migrate/node-db-migrate/issues/618)) ([3dae762](https://github.com/db-migrate/node-db-migrate/commit/3dae762)) + + + +## [0.11.5](https://github.com/db-migrate/node-db-migrate/compare/v0.11.4...v0.11.5) (2019-01-06) + + +### Bug Fixes + +* **db:** set exit code as 1 only on error ([3148cc9](https://github.com/db-migrate/node-db-migrate/commit/3148cc9)) +* Added warning on plugin loading failure ([fcffd62](https://github.com/db-migrate/node-db-migrate/commit/fcffd62)) +* **lgtm:** fix errors ([4cd5558](https://github.com/db-migrate/node-db-migrate/commit/4cd5558)) + + + ## [0.11.3](https://github.com/db-migrate/node-db-migrate/compare/v0.11.2...v0.11.3) (2018-09-08) From d6d8cdb7f9c0407076f7972a4a3e5188582856d8 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Sun, 6 Jan 2019 12:51:43 +0100 Subject: [PATCH 02/21] add sponsor Signed-off-by: Tobias Gurtzick --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 09ba6f25..45ef8e4b 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ Database migration framework for node.js # Platinum sponsors +[![WizardTales](https://www.wizardtales.com/wzrdtales.png)](https://www.wizardtales.com) + +[Details about sponsorships](https://github.com/db-migrate/node-db-migrate/issues/605) + Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/node-db-migrate#sponsor)] or reach out to magic+dbsponsorship@wizardtales.com. # Usage From cf24965a0bd8a3564d46621fef530730137ffa2a Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Sun, 6 Jan 2019 12:52:58 +0100 Subject: [PATCH 03/21] resize big image Signed-off-by: Tobias Gurtzick --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45ef8e4b..ccfa90c7 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Database migration framework for node.js # Platinum sponsors -[![WizardTales](https://www.wizardtales.com/wzrdtales.png)](https://www.wizardtales.com) +[![WizardTales](https://www.wizardtales.com/wzrdtales.png | width=100)](https://www.wizardtales.com) [Details about sponsorships](https://github.com/db-migrate/node-db-migrate/issues/605) From cc19a2b77b64db5cafd943560345710b0020c420 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Sun, 6 Jan 2019 13:00:53 +0100 Subject: [PATCH 04/21] resize big image Signed-off-by: Tobias Gurtzick --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ccfa90c7..adfd3d62 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Database migration framework for node.js # Platinum sponsors -[![WizardTales](https://www.wizardtales.com/wzrdtales.png | width=100)](https://www.wizardtales.com) +[](https://www.wizardtales.com) [Details about sponsorships](https://github.com/db-migrate/node-db-migrate/issues/605) From e18304686036b35da8b73b2b8db3100c21f2791d Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Mon, 13 Apr 2020 19:54:55 +0200 Subject: [PATCH 05/21] feat(staticLoader): a static loader to support packaging Signed-off-by: Tobias Gurtzick --- .gitignore | 3 +++ api.js | 15 +++++++++++---- generateLoader.js | 37 +++++++++++++++++++++++++++++++++++++ index.js | 7 ++----- lib/commands/run.js | 10 ++++++---- package.json | 8 ++++---- 6 files changed, 63 insertions(+), 17 deletions(-) create mode 100644 generateLoader.js diff --git a/.gitignore b/.gitignore index a9a6cc35..5dffab2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ migrations/ node_modules/ +lib/commands/generated.js +.tern-port VCSeeder/ Seeder/ *.db @@ -11,6 +13,7 @@ database.json *.sublime-workspace archive .db-migraterc +coverage.html # Vim swap files .*.sw[a-z] diff --git a/api.js b/api.js index ccf3e973..afd6c5bb 100644 --- a/api.js +++ b/api.js @@ -1,10 +1,11 @@ 'use strict'; -var load = require('./lib/commands'); +module.exports.version = require('./package.json').version; + +let load; var log = require('db-migrate-shared').log; -require('pkginfo')(module, 'version'); // jshint ignore:line var Promise; -var onComplete = load('on-complete'); +let onComplete; // constant hooks for this file var APIHooks = { @@ -17,12 +18,18 @@ var APIHooks = { }; function dbmigrate (plugins, isModule, options, callback) { + if (!options.staticLoader) load = require('./lib/commands'); + else load = require('./lib/commands/generated.js'); + + onComplete = load('on-complete'); + var dotenv = require('dotenv'); var setDefaultArgv = load('set-default-argv'); this.internals = { onComplete: onComplete, - migrationProtocol: 1 + migrationProtocol: 1, + load }; if (typeof isModule !== 'function') { this.internals.isModule = isModule; diff --git a/generateLoader.js b/generateLoader.js new file mode 100644 index 00000000..742d5465 --- /dev/null +++ b/generateLoader.js @@ -0,0 +1,37 @@ +'use strict'; + +const path = require('path'); +const recursive = require('final-fs').readdirRecursive; +const start = path.join(__dirname, 'lib/commands'); +const Promise = require('bluebird'); +const fs = require('fs'); + +(async () => { + const files = await recursive(start, true); + const template = ` +'use strict'; + +const path = require('path'); + +const files = { +${files + .map(x => ` "${x.substring(0, x.indexOf('.js'))}": require('./${x}')`) + .join(',\n')} +} + +function register (module) { + return files[module]; +} + +module.exports = register; +`; + + fs.writeFile( + path.join(__dirname, 'lib/commands/generated.js'), + template, + 'utf8', + err => { + if (err) throw err; + } + ); +})(); diff --git a/index.js b/index.js index 0340e613..65d51f9f 100644 --- a/index.js +++ b/index.js @@ -63,15 +63,12 @@ function loadPlugins (options) { return hooks; } -module.exports.getInstance = function ( - isModule, - options = { cwd: process.cwd() }, - callback -) { +module.exports.getInstance = function (isModule, options = {}, callback) { delete require.cache[require.resolve('./api.js')]; delete require.cache[require.resolve('optimist')]; var Mod = require('./api.js'); var plugins = {}; + options.cwd = options.cwd || process.cwd(); try { if (!options || !options.noPlugins) plugins = loadPlugins(options); diff --git a/lib/commands/run.js b/lib/commands/run.js index bfdfe819..f0b6fc34 100644 --- a/lib/commands/run.js +++ b/lib/commands/run.js @@ -1,11 +1,13 @@ 'use strict'; var log = require('db-migrate-shared').log; -var optimist = require('optimist'); -var load = require('./'); -var transition = load('transition'); +var yargs = require('yargs'); +var transition; function run (internals, config) { + const { load } = internals; + const transition = load('transition'); + console.log(load); var action = internals.argv._.shift(); var folder = action.split(':'); @@ -117,7 +119,7 @@ function run (internals, config) { 'Invalid Action: Must be [up|down|check|create|reset|sync|' + 'db|transition].' ); - optimist.showHelp(); + yargs.showHelp(); process.exit(1); } break; diff --git a/package.json b/package.json index 5ae006f6..e34971cd 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ ], "version": "0.11.6", "engines": { - "node": ">=0.6.0" + "node": ">=8.0.0" }, "bugs": { "url": "https://github.com/db-migrate/node-db-migrate/issues" @@ -52,14 +52,13 @@ "final-fs": "^1.6.0", "inflection": "^1.10.0", "mkdirp": "~0.5.0", - "optimist": "~0.6.1", "parse-database-url": "~0.3.0", - "pkginfo": "^0.4.0", "prompt": "^1.0.0", "rc": "^1.2.8", "resolve": "^1.1.6", "semver": "^5.3.0", - "tunnel-ssh": "^4.0.0" + "tunnel-ssh": "^4.0.0", + "yargs": "^15.3.1" }, "devDependencies": { "code": "^4.1.0", @@ -78,6 +77,7 @@ "sinon": "^4.1.2" }, "scripts": { + "prepublishOnly": "node generateLoader.js", "pretest": "eslint *.js lib/*.js test/*.js bin/*", "test": "make test-cov" } From 8b5beacdee33ce0a63805ec453de959ef689bf90 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Tue, 14 Apr 2020 21:46:58 +0200 Subject: [PATCH 06/21] fix(vuln): backport #679 Signed-off-by: Tobias Gurtzick --- api.js | 16 +- generateLoader.js | 4 +- index.js | 5 +- lib/commands/create-migration.js | 4 +- lib/commands/run.js | 2 +- lib/commands/set-default-argv.js | 30 +-- lib/config.js | 4 +- package-lock.json | 318 +++++++++++++++++++++++++++---- 8 files changed, 315 insertions(+), 68 deletions(-) diff --git a/api.js b/api.js index afd6c5bb..e3e5781f 100644 --- a/api.js +++ b/api.js @@ -64,7 +64,9 @@ function dbmigrate (plugins, isModule, options, callback) { if (typeof options.cwd === 'string') internals.cwd = options.cwd; else internals.cwd = process.cwd(); - if (typeof options.cmdOptions === 'object') internals.cmdOptions = options.cmdOptions; + if (typeof options.cmdOptions === 'object') { + internals.cmdOptions = options.cmdOptions; + } } else internals.cwd = process.cwd(); if (typeof isModule === 'function') { @@ -108,10 +110,10 @@ dbmigrate.prototype = { }, /** - * Registers and initializes hooks. - * - * @returns Promise - */ + * Registers and initializes hooks. + * + * @returns Promise + */ registerAPIHook: function (callback) { var plugins = this.internals.plugins; var self = this; @@ -316,8 +318,8 @@ dbmigrate.prototype = { }, /** - * Transition migrations to the latest defined protocol. - */ + * Transition migrations to the latest defined protocol. + */ transition: function () { load('transition')(this.internals); }, diff --git a/generateLoader.js b/generateLoader.js index 742d5465..c1d42f6a 100644 --- a/generateLoader.js +++ b/generateLoader.js @@ -15,8 +15,8 @@ const path = require('path'); const files = { ${files - .map(x => ` "${x.substring(0, x.indexOf('.js'))}": require('./${x}')`) - .join(',\n')} + .map(x => ` "${x.substring(0, x.indexOf('.js'))}": require('./${x}')`) + .join(',\n')} } function register (module) { diff --git a/index.js b/index.js index 65d51f9f..b6228af0 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ -require('pkginfo')(module, 'version'); // jshint ignore:line +module.exports.version = require('./package.json').version; + var fs = require('fs'); var path = require('path'); var log = require('db-migrate-shared').log; @@ -65,7 +66,7 @@ function loadPlugins (options) { module.exports.getInstance = function (isModule, options = {}, callback) { delete require.cache[require.resolve('./api.js')]; - delete require.cache[require.resolve('optimist')]; + delete require.cache[require.resolve('yargs')]; var Mod = require('./api.js'); var plugins = {}; options.cwd = options.cwd || process.cwd(); diff --git a/lib/commands/create-migration.js b/lib/commands/create-migration.js index 92adc3fb..dc9a4acf 100644 --- a/lib/commands/create-migration.js +++ b/lib/commands/create-migration.js @@ -4,7 +4,7 @@ var _assert = require('./helper/assert'); var log = require('db-migrate-shared').log; var mkdirp = require('mkdirp'); var fs = require('fs'); -var optimist = require('optimist'); +var yargs = require('yargs'); var util = require('util'); function createMigrationDir (dir, callback) { @@ -32,7 +32,7 @@ function executeCreateMigration (internals, config, callback) { if (internals.argv._.length === 0) { log.error("'migrationName' is required."); if (!internals.isModule) { - optimist.showHelp(); + yargs.showHelp(); } if (typeof callback !== 'function') { diff --git a/lib/commands/run.js b/lib/commands/run.js index f0b6fc34..848acf0f 100644 --- a/lib/commands/run.js +++ b/lib/commands/run.js @@ -7,7 +7,7 @@ var transition; function run (internals, config) { const { load } = internals; const transition = load('transition'); - console.log(load); + console.log('hello'); var action = internals.argv._.shift(); var folder = action.split(':'); diff --git a/lib/commands/set-default-argv.js b/lib/commands/set-default-argv.js index bd89db37..ab4ed50a 100644 --- a/lib/commands/set-default-argv.js +++ b/lib/commands/set-default-argv.js @@ -1,4 +1,4 @@ -var optimist = require('optimist'); +var yargs = require('yargs'); var log = require('db-migrate-shared').log; module.exports = function (internals, isModule) { @@ -19,7 +19,7 @@ module.exports = function (internals, isModule) { }; if (!isModule) { - internals.argv = optimist + internals.argv = yargs .default(defaultConfig) .usage( 'Usage: db-migrate [up|down|check|reset|sync|create|db|transition] ' + @@ -42,7 +42,10 @@ module.exports = function (internals, isModule) { .string('c') .describe('dry-run', "Prints the SQL but doesn't run it.") .boolean('dry-run') - .describe('check', 'Prints the migrations to be run without running them.') + .describe( + 'check', + 'Prints the migrations to be run without running them.' + ) .boolean('check') .describe( 'force-exit', @@ -98,39 +101,36 @@ module.exports = function (internals, isModule) { .describe('ignore-completed-migrations', 'Start at the first migration') .boolean('ignore-completed-migrations') .describe('log-level', 'Set the log-level, for example sql|warn') - .string('log-level'); + .string('log-level') + .parse(); } else { - const _internalsArgv = Object.assign(defaultConfig, internals.cmdOptions); - internals.argv = { - get argv () { - return _internalsArgv; - } - }; + internals.argv = Object.assign(defaultConfig, internals.cmdOptions); } var plugins = internals.plugins; var plugin = plugins.hook('init:cli:config:hook'); - var _config = internals.argv.argv.config; + var _config = internals.argv.config; if (plugin) { plugin.forEach(function (plugin) { // var configs = plugin['init:cli:config:hook'](); // if (!configs) return; - // hook not yet used, we look into migrating away from optimist first + // hook not yet used, we look into migrating away from yargs first }); } - internals.argv = deepExtend(internals.argv.argv, rc('db-migrate', {})); + internals.argv = deepExtend(internals.argv, rc('db-migrate', {})); internals.argv.rcconfig = internals.argv.config; internals.argv.config = internals.argv.configFile || _config; if (internals.argv.version) { + console.log(internals.argv.version); console.log(internals.dbm.version); process.exit(0); } if (!isModule && (internals.argv.help || internals.argv._.length === 0)) { - optimist.showHelp(); + yargs.showHelp(); process.exit(1); } @@ -147,7 +147,7 @@ module.exports = function (internals, isModule) { internals.notransactions = internals.argv['non-transactional']; internals.dryRun = internals.argv['dry-run']; global.dryRun = internals.dryRun; - internals.check = internals.argv['check']; + internals.check = internals.argv.check; if (internals.dryRun) { log.info('dry run'); diff --git a/lib/config.js b/lib/config.js index 85fc229c..f27e641a 100644 --- a/lib/config.js +++ b/lib/config.js @@ -176,8 +176,8 @@ exports.loadObject = function (_config, currentEnv) { if (currentEnv) { out.setCurrent(currentEnv); - } else if (config['default']) { - out.setCurrent(config['default']); + } else if (config.default) { + out.setCurrent(config.default); } else if (config.defaultEnv) { if (config.defaultEnv.ENV) { out.setCurrent(process.env[config.defaultEnv.ENV]); diff --git a/package-lock.json b/package-lock.json index 7524cd08..48681009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,11 @@ "samsam": "1.3.0" } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -85,6 +90,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -324,11 +330,9 @@ "dev": true }, "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, - "optional": true + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "caseless": { "version": "0.12.0", @@ -392,23 +396,42 @@ "dev": true }, "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "optional": true, + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" }, "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true, - "optional": true + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } } } }, @@ -572,9 +595,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, - "optional": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "deep-equal": { "version": "0.2.2", @@ -641,6 +662,11 @@ "safer-buffer": "^2.1.0" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1186,6 +1212,11 @@ } } }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -1459,7 +1490,8 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true + "dev": true, + "optional": true }, "is-builtin-module": { "version": "1.0.0", @@ -1626,6 +1658,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, + "optional": true, "requires": { "is-buffer": "^1.1.5" } @@ -1903,7 +1936,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "lru-cache": { "version": "4.1.5", @@ -2200,6 +2234,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, "requires": { "minimist": "~0.0.1", "wordwrap": "~0.0.2" @@ -2565,7 +2600,8 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true + "dev": true, + "optional": true }, "request": { "version": "2.88.0", @@ -2603,6 +2639,16 @@ } } }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -2739,8 +2785,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "shebang-command": { "version": "1.2.0", @@ -3157,12 +3202,51 @@ "yargs": "~3.10.0" }, "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true, "optional": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } } } }, @@ -3250,6 +3334,11 @@ "isexe": "^2.0.0" } }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -3300,7 +3389,70 @@ "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + } + } }, "wrappy": { "version": "1.0.2", @@ -3316,6 +3468,11 @@ "mkdirp": "^0.5.1" } }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", @@ -3323,16 +3480,103 @@ "dev": true }, "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "optional": true, + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "yargs-parser": { + "version": "18.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.2.tgz", + "integrity": "sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ==", "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } From 7cfdb3af8eb52312da41f5dad568a05947be90cf Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Tue, 14 Apr 2020 21:49:28 +0200 Subject: [PATCH 07/21] 0.11.7 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 48681009..18c7ebb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "db-migrate", - "version": "0.11.6", + "version": "0.11.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e34971cd..67248f83 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "programable", "api" ], - "version": "0.11.6", + "version": "0.11.7", "engines": { "node": ">=8.0.0" }, From 49a849fa90541bf35df4aa840e52db5f9272201c Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Tue, 14 Apr 2020 21:51:22 +0200 Subject: [PATCH 08/21] remove node 6 from build array Signed-off-by: Tobias Gurtzick --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 084eaa24..f86685b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: node_js node_js: - - 6 - 8 - 10 - node From 0233142d5b3dd204dcb2396c5fc2ce46280c07fc Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Wed, 15 Apr 2020 11:45:34 +0200 Subject: [PATCH 09/21] Merge pull request #684 from Marsup/ignore-dev-files Ignore development files for npm package --- .npmignore | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.npmignore b/.npmignore index a8319eaa..59680f1d 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,4 @@ -.github +.* test migrations VCSeeder @@ -9,4 +9,8 @@ database.json *.sublime-project *.sublime-workspace archive -.db-migraterc +coverage.html +Makefile +*.md +commitlint.config.js +generateLoader.js From e8a1030346936b7dbaa61d5f45bcda486a4e7e48 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Wed, 15 Apr 2020 14:28:16 +0200 Subject: [PATCH 10/21] add changelog Signed-off-by: Tobias Gurtzick --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d71581e..ac62d5df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +## [0.11.7](https://github.com/db-migrate/node-db-migrate/compare/v0.11.6...v0.11.7) (2020-04-14) + + +### Bug Fixes + +* **vuln:** backport [#679](https://github.com/db-migrate/node-db-migrate/issues/679) ([8b5beac](https://github.com/db-migrate/node-db-migrate/commit/8b5beac)) + + +### Features + +* **staticLoader:** a static loader to support packaging ([e183046](https://github.com/db-migrate/node-db-migrate/commit/e183046)) + + + +## [0.11.6](https://github.com/db-migrate/node-db-migrate/compare/v0.11.5...v0.11.6) (2019-06-08) + + +### Bug Fixes + +* **cwd:** addition of cwd missed function definition ([fae85cf](https://github.com/db-migrate/node-db-migrate/commit/fae85cf)) +* **plugin:** allow no package.json ([f27dce0](https://github.com/db-migrate/node-db-migrate/commit/f27dce0)) +* **plugin:** handle non existent dependencies and improve UX ([006ef5e](https://github.com/db-migrate/node-db-migrate/commit/006ef5e)), closes [#628](https://github.com/db-migrate/node-db-migrate/issues/628) +* **plugin:** respect options cwd ([#618](https://github.com/db-migrate/node-db-migrate/issues/618)) ([3dae762](https://github.com/db-migrate/node-db-migrate/commit/3dae762)) + + + ## [0.11.6](https://github.com/db-migrate/node-db-migrate/compare/v0.11.5...v0.11.6) (2019-06-08) From c148d9de59c99d11c18deea3babcc967c57c1cb8 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Wed, 15 Apr 2020 14:30:14 +0200 Subject: [PATCH 11/21] 0.11.8 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18c7ebb6..3b1675a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "db-migrate", - "version": "0.11.7", + "version": "0.11.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 67248f83..ac0a551e 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "programable", "api" ], - "version": "0.11.7", + "version": "0.11.8", "engines": { "node": ">=8.0.0" }, From ce77a285a3fe4dc728e81f7e140b5dc4e84a8a40 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Wed, 15 Apr 2020 21:48:43 +0200 Subject: [PATCH 12/21] chore: remove debug logs Signed-off-by: Tobias Gurtzick --- lib/commands/run.js | 1 - lib/commands/set-default-argv.js | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/commands/run.js b/lib/commands/run.js index 848acf0f..70c7849d 100644 --- a/lib/commands/run.js +++ b/lib/commands/run.js @@ -7,7 +7,6 @@ var transition; function run (internals, config) { const { load } = internals; const transition = load('transition'); - console.log('hello'); var action = internals.argv._.shift(); var folder = action.split(':'); diff --git a/lib/commands/set-default-argv.js b/lib/commands/set-default-argv.js index ab4ed50a..58cc9e71 100644 --- a/lib/commands/set-default-argv.js +++ b/lib/commands/set-default-argv.js @@ -124,7 +124,6 @@ module.exports = function (internals, isModule) { internals.argv.config = internals.argv.configFile || _config; if (internals.argv.version) { - console.log(internals.argv.version); console.log(internals.dbm.version); process.exit(0); } From bf2a25d25a7679f49139e2f7f3f484c8dfbfa5f3 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Wed, 15 Apr 2020 21:48:50 +0200 Subject: [PATCH 13/21] 0.11.9 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b1675a2..c3ed14d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "db-migrate", - "version": "0.11.8", + "version": "0.11.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ac0a551e..0158d597 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "programable", "api" ], - "version": "0.11.8", + "version": "0.11.9", "engines": { "node": ">=8.0.0" }, From b8e072184e9ac304fffcfdf8014358836c6cdd93 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Sat, 18 Apr 2020 10:46:03 +0200 Subject: [PATCH 14/21] add backing Signed-off-by: Tobias Gurtzick --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 0158d597..5523285f 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,10 @@ "rimraf": "^2.6.2", "sinon": "^4.1.2" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-db-migrate" + }, "scripts": { "prepublishOnly": "node generateLoader.js", "pretest": "eslint *.js lib/*.js test/*.js bin/*", From 91d4bc0beab835c6f4cea784eabde4887b82c05f Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Sat, 18 Apr 2020 10:47:32 +0200 Subject: [PATCH 15/21] 0.11.10 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c3ed14d1..f2a55b48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "db-migrate", - "version": "0.11.9", + "version": "0.11.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5523285f..5b689573 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "programable", "api" ], - "version": "0.11.9", + "version": "0.11.10", "engines": { "node": ">=8.0.0" }, From 4f751d8e78d8a095e8a2f03467daeec696c0daee Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Tue, 5 May 2020 10:21:17 +0200 Subject: [PATCH 16/21] add docker build Signed-off-by: Tobias Gurtzick --- .docker/all/Dockerfile | 15 +++++++++++++++ .docker/all/build.sh | 5 +++++ .docker/database.json | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 .docker/all/Dockerfile create mode 100755 .docker/all/build.sh create mode 100644 .docker/database.json diff --git a/.docker/all/Dockerfile b/.docker/all/Dockerfile new file mode 100644 index 00000000..2ca96a1f --- /dev/null +++ b/.docker/all/Dockerfile @@ -0,0 +1,15 @@ +FROM node:10 AS builder + +USER root + +COPY .docker/all/build.sh package.json /data/ + +RUN /data/build.sh + +FROM node:10-slim + +COPY --from=builder /usr/local/ /usr/local/ +COPY .docker/database.json /home/node + +USER node +WORKDIR /home/node diff --git a/.docker/all/build.sh b/.docker/all/build.sh new file mode 100755 index 00000000..f7d9df2f --- /dev/null +++ b/.docker/all/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash +export DBMVERSION=$(node -e 'console.log(require("/data/package.json").version)') + +npm i -g npm +npm i -g db-migrate{@$DBMVERSION,-{pg,cockroachdb,mysql,mongodb,sqlite3}@latest} pg-native --unsafe-perm diff --git a/.docker/database.json b/.docker/database.json new file mode 100644 index 00000000..0d90e6db --- /dev/null +++ b/.docker/database.json @@ -0,0 +1,16 @@ +{ + "dev": { + "user": { "ENV": "user" }, + "driver": { "ENV": "driver" }, + "database": { "ENV": "database" }, + "native": { "ENV": "native" }, + "host": { "ENV": "host" }, + "port": { "ENV": "port" }, + "ssl": { + "sslrootcert": { "ENV": "ca_crt" }, + "sslcert": { "ENV": "ssl_cert" }, + "sslkey": { "ENV": "ssl_key" }, + "sslmode": { "ENV": "ssl_mode" } + } + } +} From 68daf2a96791d7ff01c3b4c6f22c269048832309 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Tue, 5 May 2020 10:23:37 +0200 Subject: [PATCH 17/21] add docker build Signed-off-by: Tobias Gurtzick --- .docker/all/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.docker/all/Dockerfile b/.docker/all/Dockerfile index 2ca96a1f..64bc323f 100644 --- a/.docker/all/Dockerfile +++ b/.docker/all/Dockerfile @@ -13,3 +13,5 @@ COPY .docker/database.json /home/node USER node WORKDIR /home/node + +ENTRYPOINT ["db-migrate"] From 34156dbf63d50a701d05c73203e9147a387b6220 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Tue, 5 May 2020 13:16:55 +0200 Subject: [PATCH 18/21] 0.11.11 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index f2a55b48..12b87d34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "db-migrate", - "version": "0.11.10", + "version": "0.11.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5b689573..19141a0d 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "programable", "api" ], - "version": "0.11.10", + "version": "0.11.11", "engines": { "node": ">=8.0.0" }, From 6df45e73c4aa58bdd6d745e135c8da99402e07f0 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Wed, 30 Dec 2020 16:10:23 +0100 Subject: [PATCH 19/21] 0.11.12 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 12b87d34..03077549 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "db-migrate", - "version": "0.11.11", + "version": "0.11.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 19141a0d..8a9a25ae 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "programable", "api" ], - "version": "0.11.11", + "version": "0.11.12", "engines": { "node": ">=8.0.0" }, From 6f7878edaf45b8fb9eb7a89f18bdf841c255fa22 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Mon, 15 Nov 2021 17:29:30 +0100 Subject: [PATCH 20/21] 0.11.13 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03077549..98f66188 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "db-migrate", - "version": "0.11.12", + "version": "0.11.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8a9a25ae..6bd04949 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "programable", "api" ], - "version": "0.11.12", + "version": "0.11.13", "engines": { "node": ">=8.0.0" }, From 3f04f676fb77439350cb2229c5254453b419c00a Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Thu, 7 Sep 2023 15:30:10 +0200 Subject: [PATCH 21/21] 0.11.14 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 98f66188..eee86578 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "db-migrate", - "version": "0.11.13", + "version": "0.11.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6bd04949..88c6d77d 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "programable", "api" ], - "version": "0.11.13", + "version": "0.11.14", "engines": { "node": ">=8.0.0" },