Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Vue commands #7 #48

Merged
merged 7 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/data/git/primary-options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import AlphabeticalSort from "utils/alphabetical-sort";

const options = [
{ value: 'add', label: 'add' },
{ value: 'commit', label: 'commit' },
Expand All @@ -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(AlphabeticalSort);
2 changes: 1 addition & 1 deletion src/data/linux/index.js
Original file line number Diff line number Diff line change
@@ -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';

12 changes: 3 additions & 9 deletions src/data/linux/primary-options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import AlphabeticalSort from "utils/alphabetical-sort";

const options = [
{ value: 'list', label: 'list' },
{ value: 'cd', label: 'go to' },
Expand All @@ -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(AlphabeticalSort);
2 changes: 0 additions & 2 deletions src/data/linux/tertiary-options.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/data/next.js/index.js
Original file line number Diff line number Diff line change
@@ -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';

12 changes: 3 additions & 9 deletions src/data/next.js/primary-options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import AlphabeticalSort from "utils/alphabetical-sort";

const options = [
{ value: 'build', label: 'build' },
{ value: 'development', label: 'development' },
Expand All @@ -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(AlphabeticalSort);

2 changes: 0 additions & 2 deletions src/data/next.js/tertiary-options.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/data/npm/index.js
Original file line number Diff line number Diff line change
@@ -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';

12 changes: 3 additions & 9 deletions src/data/npm/primary-options.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import AlphabeticalSort from "utils/alphabetical-sort";

const options = [
{ value: 'install', label: 'install' },
{ value: 'uninstall', label: 'uninstall' },
{ value: 'update', label: 'update' },
{ 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(AlphabeticalSort);
2 changes: 0 additions & 2 deletions src/data/npm/tertiary-options.js

This file was deleted.

2 changes: 2 additions & 0 deletions src/data/vue.js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { primaryOptions as optionsFirst } from "./primary-options";
export { secondaryOptions as optionsSecond } from "./secondary-options";
16 changes: 16 additions & 0 deletions src/data/vue.js/primary-options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import AlphabeticalSort from "utils/alphabetical-sort";

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(AlphabeticalSort);
142 changes: 142 additions & 0 deletions src/data/vue.js/secondary-options.js
Original file line number Diff line number Diff line change
@@ -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 <preset-name>",
nb: "Allows using a saved or remote preset for project creation.",
},
{
value: "inlinePreset",
label: "Use inline preset JSON",
usage: "npm create vue@latest -- --inlinePreset <json>",
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 <port-number>",
nb: "Starts the dev server on the specified port.",
},
{
value: "host",
label: "Specify host",
usage: "vue-cli-service serve --host <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 <directory>",
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 <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 <plugin-name>",
nb: "Adds a plugin to the existing project.",
},
],
invoke: [
{
value: "plugin",
label: "Invoke a plugin",
usage: "vue invoke <plugin-name>",
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.",
},
],
};
12 changes: 3 additions & 9 deletions src/data/windows/primary-options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import AlphabeticalSort from "utils/alphabetical-sort";

const options = [
{ value: 'add', label: 'add' },
{ value: 'commit', label: 'commit' },
Expand All @@ -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(AlphabeticalSort);
13 changes: 13 additions & 0 deletions src/utils/alphabetical-sort.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function alphabeticalSort(x, y) {
if (x.value < y.value) {
return -1;
}

if (x.value > y.value) {
return 1;
}

return 0;
}

export default alphabeticalSort;