From 0867b6afad62632ad0d614e6c6f7eef4e2a4c9d7 Mon Sep 17 00:00:00 2001 From: icy-r Date: Mon, 24 Jun 2024 19:28:08 +0530 Subject: [PATCH 1/7] Added Vue commands #7 --- src/data/vue.js/index.js | 3 + src/data/vue.js/primary-options.js | 22 +++++ src/data/vue.js/secondary-options.js | 142 +++++++++++++++++++++++++++ src/data/vue.js/tertiary-options.js | 2 + 4 files changed, 169 insertions(+) create mode 100644 src/data/vue.js/index.js create mode 100644 src/data/vue.js/primary-options.js create mode 100644 src/data/vue.js/secondary-options.js create mode 100644 src/data/vue.js/tertiary-options.js diff --git a/src/data/vue.js/index.js b/src/data/vue.js/index.js new file mode 100644 index 0000000..b25c001 --- /dev/null +++ b/src/data/vue.js/index.js @@ -0,0 +1,3 @@ +export { primaryOptions as optionsFirst } from './primary-options'; +export { secondaryOptions as optionsSecond } from './secondary-options'; +export { tertiaryOptions as optionsThird } from './tertiary-options'; diff --git a/src/data/vue.js/primary-options.js b/src/data/vue.js/primary-options.js new file mode 100644 index 0000000..12f134d --- /dev/null +++ b/src/data/vue.js/primary-options.js @@ -0,0 +1,22 @@ +const options = [ + { value: "create", label: "create" }, + { value: "ui", label: "ui" }, + { value: "serve", label: "serve" }, + { value: "build", label: "build" }, + { value: "lint", label: "lint" }, + { value: "add", label: "add" }, + { value: "invoke", label: "invoke" }, + { value: "inspect", label: "inspect" }, + { value: "install", label: "install" }, + { value: "upgrade", label: "upgrade" }, +]; + +export const primaryOptions = options.sort((x, y) => { + if (x.value < y.value) { + return -1; + } + if (x.value > y.value) { + return 1; + } + return 0; +}); diff --git a/src/data/vue.js/secondary-options.js b/src/data/vue.js/secondary-options.js new file mode 100644 index 0000000..95fc789 --- /dev/null +++ b/src/data/vue.js/secondary-options.js @@ -0,0 +1,142 @@ +export const secondaryOptions = { + create: [ + { + value: "default", + label: "Use default preset", + usage: "npm create vue@latest", + nb: "Creates a project with the latest Vue.js setup.", + }, + { + value: "preset", + label: "Use a specific preset", + usage: "npm create vue@latest -- --preset ", + nb: "Allows using a saved or remote preset for project creation.", + }, + { + value: "inlinePreset", + label: "Use inline preset JSON", + usage: "npm create vue@latest -- --inlinePreset ", + nb: "Enables using an inline JSON string as the preset.", + }, + ], + ui: [ + { + value: "open", + label: "Open Vue GUI", + usage: "vue ui", + nb: "Opens a graphical interface for project management.", + }, + ], + serve: [ + { + value: "port", + label: "Specify port", + usage: "vue-cli-service serve --port ", + nb: "Starts the dev server on the specified port.", + }, + { + value: "host", + label: "Specify host", + usage: "vue-cli-service serve --host ", + nb: "Starts the dev server with the specified host.", + }, + { + value: "open", + label: "Open browser on server start", + usage: "vue-cli-service serve --open", + nb: "Automatically opens the browser when the server starts.", + }, + ], + build: [ + { + value: "dest", + label: "Specify output directory", + usage: "vue-cli-service build --dest ", + nb: "Outputs the build files to the specified directory.", + }, + { + value: "modern", + label: "Build for modern browsers", + usage: "vue-cli-service build --modern", + nb: "Creates a build optimized for modern browsers with auto fallback.", + }, + { + value: "target", + label: "Specify build target", + usage: "vue-cli-service build --target ", + nb: "Sets the build target (e.g., app, lib, wc).", + }, + ], + lint: [ + { + value: "fix", + label: "Automatically fix lint errors", + usage: "vue-cli-service lint --fix", + nb: "Runs the linter and automatically fixes errors.", + }, + { + value: "no-fix", + label: "Do not fix lint errors", + usage: "vue-cli-service lint", + nb: "Runs the linter without fixing errors.", + }, + ], + add: [ + { + value: "plugin", + label: "Add a plugin", + usage: "vue add ", + nb: "Adds a plugin to the existing project.", + }, + ], + invoke: [ + { + value: "plugin", + label: "Invoke a plugin", + usage: "vue invoke ", + nb: "Invokes a plugin generator in an already created project.", + }, + ], + inspect: [ + { + value: "config", + label: "Inspect webpack config", + usage: "vue-cli-service inspect", + nb: "Outputs the internal webpack config for inspection.", + }, + { + value: "rules", + label: "Inspect webpack rules", + usage: "vue-cli-service inspect --rules", + nb: "Displays the webpack rules configuration.", + }, + { + value: "plugins", + label: "Inspect webpack plugins", + usage: "vue-cli-service inspect --plugins", + nb: "Shows the webpack plugins configuration.", + }, + ], + install: [ + { + value: "global", + label: "Install Vue CLI globally", + usage: "npm install -g @vue/cli", + nb: "Installs Vue CLI globally using npm.", + }, + ], + upgrade: [ + { + value: "global", + label: "Upgrade Vue CLI globally", + usage: "npm update -g @vue/cli", + nb: "Upgrades the global installation of Vue CLI.", + }, + { + value: "local", + label: "Upgrade project dependencies", + usage: "vue upgrade", + nb: "Upgrades the Vue CLI service and plugins in the project.", + }, + ], +}; diff --git a/src/data/vue.js/tertiary-options.js b/src/data/vue.js/tertiary-options.js new file mode 100644 index 0000000..bfca5fc --- /dev/null +++ b/src/data/vue.js/tertiary-options.js @@ -0,0 +1,2 @@ +export const tertiaryOptions = { +}; From 9ec3945b122604af6d95b813543fcb227f54628b Mon Sep 17 00:00:00 2001 From: icy-r Date: Sat, 3 Aug 2024 21:19:57 +0530 Subject: [PATCH 2/7] chore: Refactor Vue.js imports The Vue.js imports in the file were refactored. Additionally, the file was deleted as it is no longer needed. --- src/data/vue.js/index.js | 5 ++--- src/data/vue.js/tertiary-options.js | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 src/data/vue.js/tertiary-options.js diff --git a/src/data/vue.js/index.js b/src/data/vue.js/index.js index b25c001..58f8e1d 100644 --- a/src/data/vue.js/index.js +++ b/src/data/vue.js/index.js @@ -1,3 +1,2 @@ -export { primaryOptions as optionsFirst } from './primary-options'; -export { secondaryOptions as optionsSecond } from './secondary-options'; -export { tertiaryOptions as optionsThird } from './tertiary-options'; +export { primaryOptions as optionsFirst } from "./primary-options"; +export { secondaryOptions as optionsSecond } from "./secondary-options"; diff --git a/src/data/vue.js/tertiary-options.js b/src/data/vue.js/tertiary-options.js deleted file mode 100644 index bfca5fc..0000000 --- a/src/data/vue.js/tertiary-options.js +++ /dev/null @@ -1,2 +0,0 @@ -export const tertiaryOptions = { -}; From 6c43a75637ac71bcab6363772d125091bac60064 Mon Sep 17 00:00:00 2001 From: icy-r Date: Sat, 3 Aug 2024 22:02:55 +0530 Subject: [PATCH 3/7] refactor: Refactor Vue.js imports and remove unnecessary file Refactored the Vue.js imports in the primary-options.js file and removed the tertiary-options.js file as it is no longer needed. --- src/data/git/primary-options.js | 12 +++--------- src/data/linux/index.js | 2 +- src/data/linux/primary-options.js | 12 +++--------- src/data/linux/tertiary-options.js | 2 -- src/data/next.js/index.js | 2 +- src/data/next.js/primary-options.js | 12 +++--------- src/data/next.js/tertiary-options.js | 2 -- src/data/npm/index.js | 2 +- src/data/npm/primary-options.js | 12 +++--------- src/data/npm/tertiary-options.js | 2 -- src/data/vue.js/primary-options.js | 12 +++--------- src/data/windows/primary-options.js | 12 +++--------- src/util/Shorter.js | 11 +++++++++++ 13 files changed, 32 insertions(+), 63 deletions(-) delete mode 100644 src/data/linux/tertiary-options.js delete mode 100644 src/data/next.js/tertiary-options.js delete mode 100644 src/data/npm/tertiary-options.js create mode 100644 src/util/Shorter.js diff --git a/src/data/git/primary-options.js b/src/data/git/primary-options.js index 43cb410..bdffc4d 100644 --- a/src/data/git/primary-options.js +++ b/src/data/git/primary-options.js @@ -1,3 +1,5 @@ +import Shorter from "util/Shorter"; + const options = [ { value: 'add', label: 'add' }, { value: 'commit', label: 'commit' }, @@ -21,12 +23,4 @@ const options = [ { value: 'cherrypick', label: 'cherry-pick' }, ]; -export const primaryOptions = options.sort((x, y) => { - if (x.value < y.value) { - return -1; - } - if (x.value > y.value) { - return 1; - } - return 0; -}); +export const primaryOptions = options.sort(Shorter); diff --git a/src/data/linux/index.js b/src/data/linux/index.js index b25c001..70c3819 100644 --- a/src/data/linux/index.js +++ b/src/data/linux/index.js @@ -1,3 +1,3 @@ export { primaryOptions as optionsFirst } from './primary-options'; export { secondaryOptions as optionsSecond } from './secondary-options'; -export { tertiaryOptions as optionsThird } from './tertiary-options'; + diff --git a/src/data/linux/primary-options.js b/src/data/linux/primary-options.js index 6147635..15f8d15 100644 --- a/src/data/linux/primary-options.js +++ b/src/data/linux/primary-options.js @@ -1,3 +1,5 @@ +import Shorter from "util/Shorter"; + const options = [ { value: 'list', label: 'list' }, { value: 'cd', label: 'go to' }, @@ -9,12 +11,4 @@ const options = [ { value: 'display', label: 'display' }, ]; -export const primaryOptions = options.sort((x, y) => { - if (x.value < y.value) { - return -1; - } - if (x.value > y.value) { - return 1; - } - return 0; -}); +export const primaryOptions = options.sort(Shorter); diff --git a/src/data/linux/tertiary-options.js b/src/data/linux/tertiary-options.js deleted file mode 100644 index bfca5fc..0000000 --- a/src/data/linux/tertiary-options.js +++ /dev/null @@ -1,2 +0,0 @@ -export const tertiaryOptions = { -}; diff --git a/src/data/next.js/index.js b/src/data/next.js/index.js index b25c001..70c3819 100644 --- a/src/data/next.js/index.js +++ b/src/data/next.js/index.js @@ -1,3 +1,3 @@ export { primaryOptions as optionsFirst } from './primary-options'; export { secondaryOptions as optionsSecond } from './secondary-options'; -export { tertiaryOptions as optionsThird } from './tertiary-options'; + diff --git a/src/data/next.js/primary-options.js b/src/data/next.js/primary-options.js index 6117b74..3275ed9 100644 --- a/src/data/next.js/primary-options.js +++ b/src/data/next.js/primary-options.js @@ -1,3 +1,5 @@ +import Shorter from "util/Shorter"; + const options = [ { value: 'build', label: 'build' }, { value: 'development', label: 'development' }, @@ -6,13 +8,5 @@ const options = [ { value: 'info', label: 'info' }, ]; -export const primaryOptions = options.sort((x, y) => { - if (x.value < y.value) { - return -1; - } - if (x.value > y.value) { - return 1; - } - return 0; -}); +export const primaryOptions = options.sort(Shorter); diff --git a/src/data/next.js/tertiary-options.js b/src/data/next.js/tertiary-options.js deleted file mode 100644 index 3c938ff..0000000 --- a/src/data/next.js/tertiary-options.js +++ /dev/null @@ -1,2 +0,0 @@ -export const tertiaryOptions = { -}; \ No newline at end of file diff --git a/src/data/npm/index.js b/src/data/npm/index.js index b25c001..70c3819 100644 --- a/src/data/npm/index.js +++ b/src/data/npm/index.js @@ -1,3 +1,3 @@ export { primaryOptions as optionsFirst } from './primary-options'; export { secondaryOptions as optionsSecond } from './secondary-options'; -export { tertiaryOptions as optionsThird } from './tertiary-options'; + diff --git a/src/data/npm/primary-options.js b/src/data/npm/primary-options.js index 234d7ce..3837fa5 100644 --- a/src/data/npm/primary-options.js +++ b/src/data/npm/primary-options.js @@ -1,3 +1,5 @@ +import Shorter from "util/Shorter"; + const options = [ { value: 'install', label: 'install' }, { value: 'uninstall', label: 'uninstall' }, @@ -5,12 +7,4 @@ const options = [ { value: 'list', label: 'list' } ]; -export const primaryOptions = options.sort((x, y) => { - if (x.value < y.value) { - return -1; - } - if (x.value > y.value) { - return 1; - } - return 0; -}); +export const primaryOptions = options.sort(Shorter); diff --git a/src/data/npm/tertiary-options.js b/src/data/npm/tertiary-options.js deleted file mode 100644 index bfca5fc..0000000 --- a/src/data/npm/tertiary-options.js +++ /dev/null @@ -1,2 +0,0 @@ -export const tertiaryOptions = { -}; diff --git a/src/data/vue.js/primary-options.js b/src/data/vue.js/primary-options.js index 12f134d..65ac098 100644 --- a/src/data/vue.js/primary-options.js +++ b/src/data/vue.js/primary-options.js @@ -1,3 +1,5 @@ +import Shorter from "util/Shorter"; + const options = [ { value: "create", label: "create" }, { value: "ui", label: "ui" }, @@ -11,12 +13,4 @@ const options = [ { value: "upgrade", label: "upgrade" }, ]; -export const primaryOptions = options.sort((x, y) => { - if (x.value < y.value) { - return -1; - } - if (x.value > y.value) { - return 1; - } - return 0; -}); +export const primaryOptions = options.sort(Shorter); diff --git a/src/data/windows/primary-options.js b/src/data/windows/primary-options.js index 43cb410..bdffc4d 100644 --- a/src/data/windows/primary-options.js +++ b/src/data/windows/primary-options.js @@ -1,3 +1,5 @@ +import Shorter from "util/Shorter"; + const options = [ { value: 'add', label: 'add' }, { value: 'commit', label: 'commit' }, @@ -21,12 +23,4 @@ const options = [ { value: 'cherrypick', label: 'cherry-pick' }, ]; -export const primaryOptions = options.sort((x, y) => { - if (x.value < y.value) { - return -1; - } - if (x.value > y.value) { - return 1; - } - return 0; -}); +export const primaryOptions = options.sort(Shorter); diff --git a/src/util/Shorter.js b/src/util/Shorter.js new file mode 100644 index 0000000..e143749 --- /dev/null +++ b/src/util/Shorter.js @@ -0,0 +1,11 @@ +function Shorter(x, y) { +if (x.value < y.value) { + return -1; + } + if (x.value > y.value) { + return 1; + } + return 0; +} + +export default Shorter; \ No newline at end of file From 7cc9a1cafbff9a4a51f9b20ab19076bd34a15a7e Mon Sep 17 00:00:00 2001 From: icy-r Date: Sat, 3 Aug 2024 23:59:53 +0530 Subject: [PATCH 4/7] refactor: Refactor Vue.js imports and remove unnecessary file --- src/data/git/primary-options.js | 4 ++-- src/data/linux/primary-options.js | 4 ++-- src/data/next.js/primary-options.js | 4 ++-- src/data/npm/primary-options.js | 4 ++-- src/data/vue.js/primary-options.js | 4 ++-- src/data/windows/primary-options.js | 4 ++-- src/util/{Shorter.js => AlphabeticalSort.js} | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) rename src/util/{Shorter.js => AlphabeticalSort.js} (61%) diff --git a/src/data/git/primary-options.js b/src/data/git/primary-options.js index bdffc4d..c30bd96 100644 --- a/src/data/git/primary-options.js +++ b/src/data/git/primary-options.js @@ -1,4 +1,4 @@ -import Shorter from "util/Shorter"; +import AlphabeticalSort from "util/AlphabeticalSort"; const options = [ { value: 'add', label: 'add' }, @@ -23,4 +23,4 @@ const options = [ { value: 'cherrypick', label: 'cherry-pick' }, ]; -export const primaryOptions = options.sort(Shorter); +export const primaryOptions = options.sort(AlphabeticalSort); diff --git a/src/data/linux/primary-options.js b/src/data/linux/primary-options.js index 15f8d15..6efb988 100644 --- a/src/data/linux/primary-options.js +++ b/src/data/linux/primary-options.js @@ -1,4 +1,4 @@ -import Shorter from "util/Shorter"; +import AlphabeticalSort from "util/AlphabeticalSort"; const options = [ { value: 'list', label: 'list' }, @@ -11,4 +11,4 @@ const options = [ { value: 'display', label: 'display' }, ]; -export const primaryOptions = options.sort(Shorter); +export const primaryOptions = options.sort(AlphabeticalSort); diff --git a/src/data/next.js/primary-options.js b/src/data/next.js/primary-options.js index 3275ed9..cd8d65b 100644 --- a/src/data/next.js/primary-options.js +++ b/src/data/next.js/primary-options.js @@ -1,4 +1,4 @@ -import Shorter from "util/Shorter"; +import AlphabeticalSort from "util/AlphabeticalSort"; const options = [ { value: 'build', label: 'build' }, @@ -8,5 +8,5 @@ const options = [ { value: 'info', label: 'info' }, ]; -export const primaryOptions = options.sort(Shorter); +export const primaryOptions = options.sort(AlphabeticalSort); diff --git a/src/data/npm/primary-options.js b/src/data/npm/primary-options.js index 3837fa5..98250fe 100644 --- a/src/data/npm/primary-options.js +++ b/src/data/npm/primary-options.js @@ -1,4 +1,4 @@ -import Shorter from "util/Shorter"; +import AlphabeticalSort from "util/AlphabeticalSort"; const options = [ { value: 'install', label: 'install' }, @@ -7,4 +7,4 @@ const options = [ { value: 'list', label: 'list' } ]; -export const primaryOptions = options.sort(Shorter); +export const primaryOptions = options.sort(AlphabeticalSort); diff --git a/src/data/vue.js/primary-options.js b/src/data/vue.js/primary-options.js index 65ac098..92b6a73 100644 --- a/src/data/vue.js/primary-options.js +++ b/src/data/vue.js/primary-options.js @@ -1,4 +1,4 @@ -import Shorter from "util/Shorter"; +import AlphabeticalSort from "util/AlphabeticalSort"; const options = [ { value: "create", label: "create" }, @@ -13,4 +13,4 @@ const options = [ { value: "upgrade", label: "upgrade" }, ]; -export const primaryOptions = options.sort(Shorter); +export const primaryOptions = options.sort(AlphabeticalSort); diff --git a/src/data/windows/primary-options.js b/src/data/windows/primary-options.js index bdffc4d..c30bd96 100644 --- a/src/data/windows/primary-options.js +++ b/src/data/windows/primary-options.js @@ -1,4 +1,4 @@ -import Shorter from "util/Shorter"; +import AlphabeticalSort from "util/AlphabeticalSort"; const options = [ { value: 'add', label: 'add' }, @@ -23,4 +23,4 @@ const options = [ { value: 'cherrypick', label: 'cherry-pick' }, ]; -export const primaryOptions = options.sort(Shorter); +export const primaryOptions = options.sort(AlphabeticalSort); diff --git a/src/util/Shorter.js b/src/util/AlphabeticalSort.js similarity index 61% rename from src/util/Shorter.js rename to src/util/AlphabeticalSort.js index e143749..d8c26a4 100644 --- a/src/util/Shorter.js +++ b/src/util/AlphabeticalSort.js @@ -1,4 +1,4 @@ -function Shorter(x, y) { +function alphabeticalSort(x, y) { if (x.value < y.value) { return -1; } @@ -8,4 +8,4 @@ if (x.value < y.value) { return 0; } -export default Shorter; \ No newline at end of file +export default alphabeticalSort; \ No newline at end of file From b578459265457ec8387ad3e4477c1571fe481864 Mon Sep 17 00:00:00 2001 From: icy-r Date: Sun, 4 Aug 2024 00:03:37 +0530 Subject: [PATCH 5/7] refactor: Refactor alphabeticalSort function Refactored the alphabeticalSort function in AlphabeticalSort.js to improve code readability and maintainability. --- src/util/AlphabeticalSort.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/AlphabeticalSort.js b/src/util/AlphabeticalSort.js index d8c26a4..a8f3b46 100644 --- a/src/util/AlphabeticalSort.js +++ b/src/util/AlphabeticalSort.js @@ -1,5 +1,5 @@ function alphabeticalSort(x, y) { -if (x.value < y.value) { + if (x.value < y.value) { return -1; } if (x.value > y.value) { @@ -8,4 +8,4 @@ if (x.value < y.value) { return 0; } -export default alphabeticalSort; \ No newline at end of file +export default alphabeticalSort; From 424f59c82ee86b364a67caef123475dc69075ef3 Mon Sep 17 00:00:00 2001 From: icy-r Date: Sun, 4 Aug 2024 00:07:25 +0530 Subject: [PATCH 6/7] refactor: Update import paths for AlphabeticalSort in primary-options.js files --- src/data/git/primary-options.js | 2 +- src/data/linux/primary-options.js | 2 +- src/data/next.js/primary-options.js | 2 +- src/data/npm/primary-options.js | 2 +- src/data/vue.js/primary-options.js | 2 +- src/data/windows/primary-options.js | 2 +- src/{util => utils}/AlphabeticalSort.js | 2 ++ 7 files changed, 8 insertions(+), 6 deletions(-) rename src/{util => utils}/AlphabeticalSort.js (97%) diff --git a/src/data/git/primary-options.js b/src/data/git/primary-options.js index c30bd96..d2445ab 100644 --- a/src/data/git/primary-options.js +++ b/src/data/git/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "util/AlphabeticalSort"; +import AlphabeticalSort from "utils/AlphabeticalSort"; const options = [ { value: 'add', label: 'add' }, diff --git a/src/data/linux/primary-options.js b/src/data/linux/primary-options.js index 6efb988..22db47f 100644 --- a/src/data/linux/primary-options.js +++ b/src/data/linux/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "util/AlphabeticalSort"; +import AlphabeticalSort from "utils/AlphabeticalSort"; const options = [ { value: 'list', label: 'list' }, diff --git a/src/data/next.js/primary-options.js b/src/data/next.js/primary-options.js index cd8d65b..598628c 100644 --- a/src/data/next.js/primary-options.js +++ b/src/data/next.js/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "util/AlphabeticalSort"; +import AlphabeticalSort from "utils/AlphabeticalSort"; const options = [ { value: 'build', label: 'build' }, diff --git a/src/data/npm/primary-options.js b/src/data/npm/primary-options.js index 98250fe..a25a40f 100644 --- a/src/data/npm/primary-options.js +++ b/src/data/npm/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "util/AlphabeticalSort"; +import AlphabeticalSort from "utils/AlphabeticalSort"; const options = [ { value: 'install', label: 'install' }, diff --git a/src/data/vue.js/primary-options.js b/src/data/vue.js/primary-options.js index 92b6a73..e08ac7f 100644 --- a/src/data/vue.js/primary-options.js +++ b/src/data/vue.js/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "util/AlphabeticalSort"; +import AlphabeticalSort from "utils/AlphabeticalSort"; const options = [ { value: "create", label: "create" }, diff --git a/src/data/windows/primary-options.js b/src/data/windows/primary-options.js index c30bd96..d2445ab 100644 --- a/src/data/windows/primary-options.js +++ b/src/data/windows/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "util/AlphabeticalSort"; +import AlphabeticalSort from "utils/AlphabeticalSort"; const options = [ { value: 'add', label: 'add' }, diff --git a/src/util/AlphabeticalSort.js b/src/utils/AlphabeticalSort.js similarity index 97% rename from src/util/AlphabeticalSort.js rename to src/utils/AlphabeticalSort.js index a8f3b46..479a143 100644 --- a/src/util/AlphabeticalSort.js +++ b/src/utils/AlphabeticalSort.js @@ -2,9 +2,11 @@ function alphabeticalSort(x, y) { if (x.value < y.value) { return -1; } + if (x.value > y.value) { return 1; } + return 0; } From 13e543e9314bde162815c3fc0ff3af370977f1dc Mon Sep 17 00:00:00 2001 From: icy-r Date: Sun, 4 Aug 2024 16:51:21 +0530 Subject: [PATCH 7/7] refactor: Update import paths for AlphabeticalSort in primary-options.js files --- src/data/git/primary-options.js | 2 +- src/data/linux/primary-options.js | 2 +- src/data/next.js/primary-options.js | 2 +- src/data/npm/primary-options.js | 2 +- src/data/vue.js/primary-options.js | 2 +- src/data/windows/primary-options.js | 2 +- src/utils/{AlphabeticalSort.js => alphabetical-sort.js} | 0 7 files changed, 6 insertions(+), 6 deletions(-) rename src/utils/{AlphabeticalSort.js => alphabetical-sort.js} (100%) diff --git a/src/data/git/primary-options.js b/src/data/git/primary-options.js index d2445ab..01e0439 100644 --- a/src/data/git/primary-options.js +++ b/src/data/git/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "utils/AlphabeticalSort"; +import AlphabeticalSort from "utils/alphabetical-sort"; const options = [ { value: 'add', label: 'add' }, diff --git a/src/data/linux/primary-options.js b/src/data/linux/primary-options.js index 22db47f..49d2167 100644 --- a/src/data/linux/primary-options.js +++ b/src/data/linux/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "utils/AlphabeticalSort"; +import AlphabeticalSort from "utils/alphabetical-sort"; const options = [ { value: 'list', label: 'list' }, diff --git a/src/data/next.js/primary-options.js b/src/data/next.js/primary-options.js index 598628c..abb3838 100644 --- a/src/data/next.js/primary-options.js +++ b/src/data/next.js/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "utils/AlphabeticalSort"; +import AlphabeticalSort from "utils/alphabetical-sort"; const options = [ { value: 'build', label: 'build' }, diff --git a/src/data/npm/primary-options.js b/src/data/npm/primary-options.js index a25a40f..923c583 100644 --- a/src/data/npm/primary-options.js +++ b/src/data/npm/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "utils/AlphabeticalSort"; +import AlphabeticalSort from "utils/alphabetical-sort"; const options = [ { value: 'install', label: 'install' }, diff --git a/src/data/vue.js/primary-options.js b/src/data/vue.js/primary-options.js index e08ac7f..b0d62a0 100644 --- a/src/data/vue.js/primary-options.js +++ b/src/data/vue.js/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "utils/AlphabeticalSort"; +import AlphabeticalSort from "utils/alphabetical-sort"; const options = [ { value: "create", label: "create" }, diff --git a/src/data/windows/primary-options.js b/src/data/windows/primary-options.js index d2445ab..01e0439 100644 --- a/src/data/windows/primary-options.js +++ b/src/data/windows/primary-options.js @@ -1,4 +1,4 @@ -import AlphabeticalSort from "utils/AlphabeticalSort"; +import AlphabeticalSort from "utils/alphabetical-sort"; const options = [ { value: 'add', label: 'add' }, diff --git a/src/utils/AlphabeticalSort.js b/src/utils/alphabetical-sort.js similarity index 100% rename from src/utils/AlphabeticalSort.js rename to src/utils/alphabetical-sort.js