From 5abf4c4e06124b607150a5256a14b3e5287f590f Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Thu, 11 Apr 2019 16:25:37 -0400 Subject: [PATCH] fixes #1026 (#1028) --- client/modules/IDE/reducers/project.js | 10 ++++++++-- package-lock.json | 14 +++++--------- package.json | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/client/modules/IDE/reducers/project.js b/client/modules/IDE/reducers/project.js index 807d76a7..5371280a 100644 --- a/client/modules/IDE/reducers/project.js +++ b/client/modules/IDE/reducers/project.js @@ -1,8 +1,14 @@ -import generate from 'project-name-generator'; +import friendlyWords from 'friendly-words'; import * as ActionTypes from '../../../constants'; +const generateRandomName = () => { + const adj = friendlyWords.predicates[Math.floor(Math.random() * friendlyWords.predicates.length)]; + const obj = friendlyWords.objects[Math.floor(Math.random() * friendlyWords.objects.length)]; + return `${adj} ${obj}`; +}; + const initialState = () => { - const generatedString = generate({ words: 2 }).spaced; + const generatedString = generateRandomName(); const generatedName = generatedString.charAt(0).toUpperCase() + generatedString.slice(1); return { name: generatedName, diff --git a/package-lock.json b/package-lock.json index e23af10d..71312297 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5043,6 +5043,11 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, + "friendly-words": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/friendly-words/-/friendly-words-1.1.3.tgz", + "integrity": "sha512-o4wUonKIZlPiVL3Q/qah1SBKrTlGAk9t8Tv1VUk24plhPib0I5utFszQlzHIuFpOIhYX0+GQ0VNQ7KSmr4Y3CQ==" + }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -12902,15 +12907,6 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "project-name-generator": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/project-name-generator/-/project-name-generator-2.1.6.tgz", - "integrity": "sha512-5r5MzHoNf7GTKg0V7zZvolpip5UAQiVpfcSN6QfEK8i/fSKlusJwxzEsKty9ce8h0e5GLoQ85dIGgV1TAnj3Kg==", - "requires": { - "commander": "^2.15.1", - "lodash": "^4.17.10" - } - }, "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", diff --git a/package.json b/package.json index 8dc0e8e4..ad9f6469 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "express": "^4.16.4", "express-basic-auth": "^1.1.6", "express-session": "^1.15.6", + "friendly-words": "^1.1.3", "htmlhint": "^0.10.1", "is-url": "^1.2.4", "js-beautify": "^1.8.9", @@ -123,7 +124,6 @@ "passport-local": "^1.0.0", "pretty-bytes": "^3.0.1", "primer-tooltips": "^1.5.11", - "project-name-generator": "^2.1.5", "prop-types": "^15.6.2", "q": "^1.4.1", "react": "^16.7.0",