aiiinotate 0.2.8 → 0.2.9

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.
package/cli/migrate.js CHANGED
@@ -61,12 +61,12 @@ function migrateMake(migrationName) {
61
61
 
62
62
  /** apply all pending migrations */
63
63
  function migrateApply() {
64
- migrationConfigs.map((mc) => execSync(`npx migrate-mongo up -f ${mc}`));
64
+ migrationConfigs.map((mc) => execSync(`npx -- migrate-mongo@^12.1.3 up -f ${mc}`));
65
65
  }
66
66
 
67
67
  /** revert the last migration */
68
68
  function migrateRevert() {
69
- migrationConfigs.map((mc) => execSync(`npx migrate-mongo down -f ${mc}`));
69
+ migrationConfigs.map((mc) => execSync(`npx migrate-mongo@^12.1.3 down -f ${mc}`));
70
70
  }
71
71
 
72
72
  /** revert all migrations */
@@ -76,7 +76,7 @@ function migrateRevertAll() {
76
76
  // do this for each migration file (prod and test database).
77
77
  migrationConfigs.map((mc) =>
78
78
  fs.readdirSync(dirMigrationsScripts).map((_) =>
79
- execSync(`npx migrate-mongo down -f ${mc}`)
79
+ execSync(`npx migrate-mongo@^12.1.3 down -f ${mc}`)
80
80
  )
81
81
  )
82
82
  }
@@ -8,7 +8,6 @@ function loadMongoClient() {
8
8
  try {
9
9
  const client = new MongoClient(
10
10
  process.env.MONGODB_CONNSTRING,
11
- { useUnifiedTopology: false, useNewUrlParser: false }
12
11
  );
13
12
  client.db(process.env.MONGODB_DB);
14
13
  return client;
package/docker/Dockerfile CHANGED
@@ -15,6 +15,8 @@ WORKDIR /aiiinotate
15
15
  COPY ./config/.env /aiiinotate/.env
16
16
  # install the app as an NPM library
17
17
  RUN npm i -g aiiinotate
18
+
19
+ RUN npm i -g migrate-mongo@^12.1.3
18
20
  # migrate the database
19
21
  RUN aiiinotate --env=/aiiinotate/.env -- migrate apply
20
22
  # expose the used port
@@ -23,12 +23,13 @@ export default (config) => ({
23
23
 
24
24
  databaseName: config.dbName,
25
25
 
26
- options: {
27
- // useNewUrlParser: true, // removes a deprecation warning when connecting
28
- // useUnifiedTopology: true, // removes a deprecating warning when connecting
29
- // connectTimeoutMS: 3600000, // increase connection timeout to 1 hour
30
- // socketTimeoutMS: 3600000, // increase socket timeout to 1 hour
31
- }
26
+ options: {}
27
+
28
+ // setting `true` causes an error in docker and a warning in node.
29
+ // options: {
30
+ // useNewUrlParser: true, // removes a deprecation warning when connecting
31
+ // useUnifiedTopology: true, // removes a deprecating warning when connecting
32
+ // }
32
33
  },
33
34
 
34
35
  // The migrations dir, can be an relative or absolute path. Only edit this when really necessary.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiiinotate",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "a fast IIIF-compliant annotation server",
5
5
  "main": "./cli/index.js",
6
6
  "type": "module",