Skip to content

Commit

Permalink
Merge pull request #13197 from finnsnape/fix/deprecated-uuid
Browse files Browse the repository at this point in the history
Fix deprecated UUID
  • Loading branch information
Convly committed Jul 27, 2022
2 parents c1366d4 + c329385 commit 6b447a7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/core/strapi/lib/utils/machine-id.js
@@ -1,14 +1,14 @@
'use strict';

const { machineIdSync } = require('node-machine-id');
const uuid = require('uuid');
const { v4: uuidv4 } = require('uuid');

module.exports = () => {
try {
const deviceId = machineIdSync();
return deviceId;
} catch (error) {
const deviceId = uuid();
const deviceId = uuidv4();
return deviceId;
}
};
2 changes: 1 addition & 1 deletion packages/core/strapi/package.json
Expand Up @@ -128,7 +128,7 @@
"resolve-cwd": "3.0.0",
"semver": "7.3.7",
"statuses": "2.0.1",
"uuid": "^3.3.2"
"uuid": "^8.3.2"
},
"devDependencies": {
"supertest": "6.2.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/generators/app/lib/index.js
Expand Up @@ -3,7 +3,7 @@
const { join, resolve, basename } = require('path');
const os = require('os');
const crypto = require('crypto');
const uuid = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const sentry = require('@sentry/node');
// FIXME
/* eslint-disable import/extensions */
Expand Down Expand Up @@ -42,7 +42,7 @@ const generateNewApp = (projectDirectory, cliArguments) => {
template: cliArguments.template,
starter: cliArguments.starter,
},
uuid: (process.env.STRAPI_UUID_PREFIX || '') + uuid(),
uuid: (process.env.STRAPI_UUID_PREFIX || '') + uuidv4(),
docker: process.env.DOCKER === 'true',
deviceId: machineID(),
tmpPath,
Expand Down
4 changes: 2 additions & 2 deletions packages/generators/app/lib/utils/machine-id.js
@@ -1,14 +1,14 @@
'use strict';

const { machineIdSync } = require('node-machine-id');
const uuid = require('uuid');
const { v4: uuidv4 } = require('uuid');

module.exports = () => {
try {
const deviceId = machineIdSync();
return deviceId;
} catch (error) {
const deviceId = uuid();
const deviceId = uuidv4();
return deviceId;
}
};
2 changes: 1 addition & 1 deletion packages/generators/app/package.json
Expand Up @@ -46,7 +46,7 @@
"node-machine-id": "^1.1.10",
"ora": "^5.4.0",
"tar": "6.1.11",
"uuid": "^3.3.2"
"uuid": "^8.3.2"
},
"engines": {
"node": ">=14.19.1 <=16.x.x",
Expand Down

0 comments on commit 6b447a7

Please sign in to comment.